In addition to hostels, look at hostales, which are not hostels, but inexpensive hotels. In Spain, a single private room in a hostal can be cheap enough to be a good alternative to a hostel.
For instance, in Madrid, I stayed at the Hostal Acapulco, for €57 a night in 2015, with an ensuite bathroom. It's in a great location in the center of town, but on a quiet street. I'd definitely stay here again. http://www.hostalacapulco.com/
(I know you said you're fluent in Spanish, but for anyone else reading this who is not: You can get the website in English by clicking the British flag. However, while my reservation was handled directly by e-mail in English with no problems, the desk staff was mostly Spanish speaking only).
I don't have recommendations for your other cities, but look at Eurocheapo for accommodation ideas for Seville: http://www.eurocheapo.com/seville/
As for meals, many restaurants have lunch specials (menu del dia) for about €12; this is a full multi-course meal, and is a great deal. Some places in Madrid had dinner deals as well. Beware that tapas can start to add up if you're hungry, so while they are cheap per tapa, it's not necessarily a cheap meal in all.
To compare buses and trains, you have to do a bit of legwork. Trains will be much cheaper if bought in advance and if you can commit to non-refundable tickets. AVE (high speed) trains will be much faster than buses. Currently, the AVE or Avant (shorter high speed train segments) connect Madrid to Cordoba to Seville. Granada is not yet on the AVE network (they're building the link now). Instead, you take a train as far as Antequera, then connect to a bus (run by Renfe, the rail company) that goes from the Antequera train station to the Granada train station. All other buses for Granada use the Granada bus station, quite a bit farther away from the center.
Bus are much cheaper. They will be much slower than the AVE, and can be slower than regular trains if there is a direct train. However, on train routes where you have to change, a bus can be easier as well as faster than the train. This was the case in 2005 when I went from Cordoba to Granada by bus (not sure if it's still true). Spanish buses are much nicer than Greyhound in the US. You get a reserved seat, and on some routes you get an airplane-style seatback entertainment system (USB charging plug, video screen, and even an electrical outlet). Luggage goes under the bus for long distance rides, so that's easy as well.
To find train fares, use the Renfe website http://www.renfe.com/EN/viajeros/index.html following the directions in the tutorial Chani linked. If you want to buy tickets, use Paypal, which works, instead of US credit cards, which usually don't.
To find bus routes, a great start is Rome2Rio: https://www.rome2rio.com/. Find all the bus companies that work on a particular route, then go directly to those bus company's websites to get details of times and prices. Some routes have only one bus company, some have more than one, all at different frequencies and prices.
As for gay life in the cities you're going to, Madrid will not only have the most (as the largest city), but the most accessible for the visitor (gay visibility is very high all over central Madrid all the time, not just at night and not just in the "gayborhood" of Chueca). Do look for the most current information about bars and clubs, and take seriously the note above about their hours. If you don't know the term madrugada, you'll learn it fast. That's the time between about midnight and 6 AM. So, what we call "two in the morning" in Spain is known as dos de la madrugada.