It's hard enough to make exercise happen everyday but then it has to hurt, too? Yes, it has to hurt if you want to see results. Here is what I understand to be true.
If you have gained weight and let your shape get soft, then your muscles need work. When you push what you can do physically, you stress the soft tissue and it gets sore. This is when you use muscles you don't use in your daily life (like horse back riding), or when you weight train and work your muscle groups to failure (like when you think you can't do one more rep and you painfully do two!). In both examples, it is best to give your body (specifically those sore muscles) a day of recovery by working a different group of muscles. And drink lots and lots of water.
So the answer to the question "Does exercise have to hurt?" is yes, if you want to see results. When you get into your routine and find that your routine is getting easy, you need to do the things that make you sweat, and make your muscles sore again. Keep upping the ante! Do keep in mind however, there is a difference between sore muscles as you get in shape and an injury. If you are hurting because you have sprained your ankle, you need to see a doctor and stay off your feet.