As someone who is an avid cyclist/racer and daily spinning junkie who rides 400 miles a week folded in half, I know that all certified Spinning instructors are taught how to properly set up a bike for their clients. So start with your setup---it's the easiest to diagnose and correct. Even if you think your bike is properly set up, have an instructor double-check it for you every few weeks. It's free, too!
The fact that your lower back hurts could be many things. The first question is what type of pain you have. Unless you are an MD, don't diagnose yourself. Ask an expert. Is it muscular, spinal, neuro, or organic? I say organic because lack of proper hydration affects the kidneys, which are located in your lower back. I should know: I had 3 kidney stone attacks due to dehydration. In a typical 1 hour class, you should drink 8 oz before, 8-12 oz during, and 8 oz after class. Assuming you are set up right and well hydrated, you should have the instructor look at your form. If everything else is normal, then you are likely to be leaning too far forward, hyperextending your back muscles. The key is to sit up straighter with your head, your neck and your spine in a straight line. Learn to flex with your hip flexors, not with your spine. Before and after spin, you need to stretch your back muscles. Use the whirlpool to promote healing. Every day you should work on lower back flexibility without weight machines. You will also need to work on making your core/ab muscles stronger because they are the stronger muscles that support your back.
Happy Trails!
D'Arrow