Just a guess - but if cramps aren't typical for you the spinning class may have been the culprit.
You were asking your legs to go faster than they are accustomed to (the suggested rate was 90 RPM and you were having trouble maintaining beyond 80 if I understand correctly).
It takes a long time (months, and sometimes years) to develop the neural pathways that speed up your cadence, and until those pathways are well-developed, your effort at a higher cadence is going to be inefficient. Thus the cramping - the few muscle fibers that had already "learned" the faster-cadence bit were overworking, and the more laid-back ones were loafing.
If this is the "problem" ("problem" in quotes because it's a symptom of imminent improvement), all the nutrition and hydration in the world won't fix it - just time, effort, and experience.