World ruling body FIFA announced the punishment on Tuesday following a meeting of its disciplinary committee.
Several black England players were subjected to monkey noises and other abusive chants from the crowd during their 1-0 defeat at the Bernabeu stadium on November 17.
The punishment also took into account racist abuse at the under-21 match the previous evening.
FIFA which has adopted a strong anti-racism stance warned in a statement that any repeat of the racist behaviour could result in them playing behind closed doors or expulsion from one or several FIFA competitions.
The Spanish Football Federation is also investigating the behaviour of national team coach Luis Aragones after his controversial comments about Arsenal's black French player Thierry Henry and England's colonial past before the match.