Many Spanish banks now accept forgien, non-resident clients and will set up an account. Two which come to mind are Banco Popular (the first to accept non-Spanards), and Caixa. I understand there are more. Just go to a bank and ask. Of course be sure to bring documentation, proof of identity (passport), any student id, maybe a letter from the institution at which you are studying in Spain. Also your US bank routing number and account number.
As far as ATM charges, yes, you can get an unpleasant suprise. Be careful when you make withdrawals, especially at open air, public ATMs (those not enclosed in their own little room). I strongly suspect I had about $5000 ripped off about three years ago, I know not how, after I used an ATM machine in Hoyo de Manzanares. Best to ask inside the bank first about charges.
Good luck, and let us know what happens!