That said, the motivation is still greater when the students see some hope that what they are learning is meaningful.
What that motivation is depends on the level of the class. For algebra 2, it might be "we learn to manipulate rational functions because it gives us a tool to understand (or solve) a certain class of problems. Someday you may own a business where you have to worry about the average cost of something that depends on things that change alot, or variables as we call them. And you know what an average is: it's the amount of something divided by how many there are. Well if your amounts are represented by an algebraic expression, and your total is represented by an algebraic expression, then the quantity you will be interested in will look something like this (writes a rational function on the board). Now, what the fuck do we do with this?"
In motivating them you don't necessarily have to give every reason to learn something, just reason enough to buy into what you are trying to teach them.