Are squats good or bad, let me see you squat. Yes, squats how you just did them will indeed cause your knees to hurt. Yoga gets trickier, there are so many forms of yoga that one form can be completely different than another. Some things to consider, are there more people in the room than digits on your hand? Unless your very good at yoga, you need someone watching you correcting your form. Slight pressure here vs here, goes a long way. So unless your great, get to a smaller class. Get a teacher that makes corrections, just isn't "practicing" while you pay them.
Pilates is a different beast all together as I think that hands on is much more important. Constant correction to get the right muscle cues are very important. For some reason I see a lot of messed up diaphragms on people that do Pilate's a lot. I think they are substituting psoas/iliacus for the lower abdominal/obliques.
What gets even trickier, when an exercise can be both good and bad. I often watch patients lunge for an evaluation. It often times isn't pretty. So at this point a lunge for strength correction would be a horrible idea. You would strengthen the dysfunction. Clearing out what you find and watch the lunge pattern become smoother and more powerful, now the lunge becomes an excellent exercise.
So this leads to the notion "I had hip pain, did a bunch of lunges, my hip got better." This information is passed on to family/friends. Family/friends don't improve by doing a bunch of lunges. Your back hurts, "do these yoga stretches and your back will feel great." Really?
The point of this rant was, yes, things can be both good and bad. Frustrating, maybe. When in life do you want to just be a cog in a machine. Why do you want movement to be? You are unique, whats good for Peter, might not be good for Paul. Find the things for you that will make improvements in your health and fitness.