There is a control at the main station but you may not be stopped.
With that said, you HAVE TO have an official document with you and that's only your passport. With every other document you will have problems, since you are "illegally" visiting the country and you're undocumented. (The situation in Europe is hot because of terrorism, so it's not the best time to play with your documentation.)
Now, in Spain (I am from Spain), you need your passport. Without a passport, if you do have to go through a control point, it will be really difficult for you to enter the country. If you are not stopped at your arrival point, but maybe are later, you could be punished, since you are undocumented.
Summarizing, you can try without your passport, but there is a high risk and, of course, your student ID is not valid as official document in Spain, although it may be an official document in your country, so you can use to get some discounts maybe but it is not valid as identification document.
So my tip, travel always with your passport or don't travel.