Classes are great for teaching you form and how certain types of workouts are safely conducted. I'm an advocate of classes to help people stay motivated and learn proper techniques. However, once one has learned the basics they can move onto fitness study on their own. Yet this depends on their personality and whether or not they can stay motivated in solo routines.
If you are just learning something you will definitely need a class. They will show you how to complete certain moves that lead to the greatest benefits and a serious reduction in the chance of injury. You will spend your money wisely if you avoid a life-long injury.
Likewise, if you want to engage in group type sports and activities you will want to join a class. Being around other people helps you to learn and gain knowledge from different people. Most people are willing to show you how smart they are by sharing advice.
If you have a hard time staying motivated on your own you may need a regular few day a week class to socialize and create group support of each other. When you miss and your classmates text you then you will see how motivating group type work can be. Eventually you meet friends and create a social network.
Once you have learned the skills you need and have enough knowledge to practice on your own you don't need the same level of "hand holding" and costs inherent in classes. You will need to take your practice seriously and occasionally frequent a class if you need clarification on something or need a boost of motivation. Therefore, find "pay as you go" classes if you can.