You do generally need to apply for a fresh long-stay visa from scratch, a residence permit from a Schengen or EU country is only valid in that country and does not allow you to reside in another one. Depending on the destination, your citizenship and other details, you might or might not be able to apply for the new residence permit from within the country, while on a visa-free visit or staying under a short-stay visa.
- The EU blue card. If you got one and you stayed at least 18 months in the country that issued it, it's supposed to be easier to move between the participating countries (i.e. not the whole EU, and unfortunately for you, I don't think Spain fully implements it until now). Not sure how it works in practice.
- If you are a permanent resident in your current country of residence, EU Council Directive 2003/109/EC grants you additional rights, including a right to reside in other EU countries under certain conditions. In theory, this directive covers the whole EU (and not merely the Schengen area or the countries that opted in the blue card scheme) but here again, I am not too sure how well it works in practice.
As you said you were a student, these exceptions almost certainly do not apply to you as the EU blue card is for full-time (or almost full-time) qualified work and staying as a student does not allow you to accrue permanent residency (stays “in order to pursue studies or vocational training” are explicitly excluded from the scope of the directive).
Note that if you have the right to stay in the Schengen area and want to work for a short time (less than three months) but not move permanently to another Schengen country, it should in theory be possible to do it with your current residence permit/visa. You “merely” need to secure an authorization to work (but not an authorization to stay, which you already have).
Finally, there are also other rules for EU citizens' families. Having an EU citizen partner would allow you to bypass all the usual requirements.