This quote has been used in many movies, but it is most attributed to Mexican revolutionary leader Emiliano Zapata. There are consequences for both taking stand for what you believe in and compromising yourself. If you choose to live on your feet and not submit to the powers that be, you may sacrifice your life for the cause you believe in. This quote means that it is preferable to do that, than to submit and spend it subjected to injustice just to preserve life.
Here is a clip from the 2014 movie, 300: Rise Of An Empire where this quote is used:
While the exact quote isn’t said word for word in 2007’s The Kingdom, a variation of it is said and it is illustrated very well. The FBI Director, played by Richard Jenkins, tells the Attorney General, played by Danny Huston, that he put his job on the line when he decided to make a stand. He said when you realize that life is finite, the end doesn’t matter as much. But what does, is how do you want to go out? On your feet or on your knees?
It is important to know what your non-negotiables are. What hill are you willing to die on?