Spain is not a bad place to party all night drink and have fun with friends. The prices for a drink in some bars or pubs in Spain can be quite reasonable, around 6 to 8 euros although you might find some places with drinks at 5 euros as well, and most pubs don’t close up until 3 or 4 AM.
Discos normally open around 00:30-1:00, although some open earlier than that. Entry prices vary wildly from disco to disco, but normal discos may not charge you more than 10-15 (sometimes 20) euros per person to enter, with one or two drinks per person (although some may not give you drinks with the entry ticket). Other more popular discos may charge you more for entry although there are more promotions and things like that to enter without paying too much.
After a night of partying if you look for a good place to relax before going home or eat something, you may go to a cafeteria or a “Churrería” to have the traditional spanish “Churros” or just grab something to eat. If you want to still party, there is bunch of “After Hours” clubs available as well which remain open after the discos normal closing time 6:30.
PS: The prices I just mentioned are more the prices of the city of Madrid, where I live. In other places of Spain the prices may be higher or lower than that. For example, Marbella’s “Puerto Banús” is much expensive than that, while prices in Salamanca are similar or even a little lower (in some places) without the quality of the places or the drinks being inferior at all.