As of 2017 you no longer need to buy a German SIM card, as all roaming fees have been abolished within the EU. Therefore you can use your regular Spanish tariff and not worry about any extra fees.
Please be aware of some rule changes when it comes to registration and activation of SIM cards as of July 2017. Some providers have chosen not to sell prepaid SIM cards anymore as they did not want to deal with the paperwork required.
On eBay Germany there are many sellers of German SIM cards with shipping abroad, just check this category: http://www.ebay.de/sch/SIM-Karten-/29778/i.html
P.S. I actually had a German ALDI Talk SIM card, and then after not using it at all for 21 months (not even being in Germany, and not putting the SIM card in the phone), I was back in Germany and found out the SIM card still worked (although it had zero balance). I just recharged 15 EUR from a train station machine, and was good to go, so you might check your old SIM card, maybe it also still works.
Actually ALDI Talk is pretty good value if you use a lot of data, as you can get 1 GB each day for 2 EUR daily fee, and I found out that I use about half a GB on an average day. The only downside is that it only has good data in big cities (it had LTE in Berlin), and just outside the city it was only GPRS/EDGE, very poor speed, so if you plan to use it outside the cities, you might want to buy a Vodafone SIM card for example.
i used a lebara sim card in germany and the internet works really good.
maybe this will be a opportunity for you.
I found the card here beachsim
Try searching in Amazon Germany “prepaid simkarte”. This is just an example from the search result. Some sellers provide information regarding delivery fee (click on Internationale und Inlandsversandkosten). For example, the first seller charges 1.50€ to send the SIM card to Spain.
At least one company is shipping outside Germany: http://www.travel-sim-germany.com
Credit:stackoverflow.com‘