While it's fair to openly call Amazon a thief for their fiscal practices, in your particular case there is nothing wrong.
If you are based in Spain (based on your amazon.es example) or any other EU country and are eligible for VAT deduction (i.e., you are a company or an individual acting as a professional or autonomous worker) and purchase goods in another EU country, then you should get an international VAT ID number. Then you file specific paperwork for EU purchases and these become effectively VAT-free. Check with your accountant.
In short, fill tax form 036 for companies or 037 for individuals to get an international VAT id.
Then every quarter as you fill your form 303 tax returns you declare your EU purchases and sales, and you will have to add a form 349 listing these.
The process is similar in all EU countries, except quite a few automatically assign all companies an international VAT number and they can skip step 1.