The European Commission said Spanish government support, including tax breaks and overpriced land transfers, gave the clubs an "unfair advantage" over others.
Germany's Khedira out of Euro 2016 semi-final v France
The other clubs were Valencia, Athletic Bilbao in the Spanish top flight and Atletico Osasuna, Elche and Hercules in the second division.
"Using taxpayers' money to finance professional football clubs can create unfair competition," EU Competition Commissioner Margrethe Vestager said in a statement.
"Professional football is a commercial activity with significant money involved and public money must comply with fair competition rules.
"The subsidies we investigated in these cases did not."
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ