If you mean to say "Hostel" and not "Hotel" then try the "Costa Rica Backpackers Hotel- see ling below. They are located in San Jose. I do not necessarily recommend staying in San Jose for an entire month as it is by far the least charming areas of Costa Rica.
There are several places you can take Spanish lessons throughout the Country- if you need accredited classes then you will have to study at the University in San Pedro- just north of San Jose.
I personally spent a summer down there studying and stayed in San Pedro Mon-Thursday, then bolted somewhere different over the weekends. It was a fun time but I often wish I had not stayed in the city so much.
Some of the other recommend places to study are:
Tamarindo, Jaco and Monteverde areas. Those three areas have the most established schools and are popular areas so you will have things to do outside of class.
There are several places to stay for under $15 a night throughout the entire country so budget should not be a problem. You can even rent apartments for about $200 a month in most places too.
Enjoy your trip and just remember this one phrase and you will do great-
PURA VIDA