I am an undergraduate myself, so take my advice with that in mind. Information comes from countless hours of research on graduate programs and talking to multiple teachers however.
If you are planning on attending graduate school in pure mathematics, your definitely not going to want Spanish. The graduate programs usually have some reading proficiency requirement in German, French, or Russian. Sometimes Italian is also on the list. ("Scholarly Languages") From what I've heard, the reading proficiency tests usually aren't that intense, if you know the math it can be easy to fill in the blanks. Though that will vary from school to school.
Beyond the requirement in graduate school, the teachers I've talked to have said most academic papers are being published in English at this point anyway, so they didn't know how much merit there will be in studying a foreign language for academic purposes after a couple more years. They even suggested that graduate school programs are changing this requirement, though I wouldn't bet on that.
If your interested in reading classical texts in mathematics, from my experience German or French might be most useful to that end.
German is supposed to be the 2nd most widely used language on website...not sure where I got that statistic so take that with little faith.
Hope that was some help.
Good luck!