I don't think the time commitment issue will matter - you can always prioritize and set aside time, whether you're in MPH school, law school, med school, etc. I personally find it useful to "block" time, saying you'll always do one hour of Spanish from 9-10 PM everyday. Once you get in a routine, you'll increase the odds of sticking to it throughout the MPH.
If you're learning the language de novo, then classes really help to learn the basic grammar (so if you can sit in on some classes at your university, rather than actually taking the class and having that commitment, that could be useful). They'll probably just give you a textbook and tell you to read that. You could, if you want, find pdfs [or actual textbooks] and read those in your free time.
But really, the only way to actually learn the language is to actually speak it and listen to it, particularly in other countries. See if you can travel as part of your MPH. Or join a language group on campus. If you google 'skype foreign language group forums' you'll find forums where you can pair up with practice partners (i.e., you practice your Spanish with some random person from Mexico for 30 mins, then you help them with their English for 30 mins).
And then I know this is not the focus of the thread, but choosing a useful language is also important. It depends where you want to work. Spanish is good if you want to work in the US b/c of the increasing Hispanic population; you can also work in Latin America.