Costa injured his hamstring against Liverpool in Chelsea's penultimate game of the season.
Atletico Madrid striker Fernando Torres was also absent from the squad despite his improved form towards the end of the season, as were Arsenal midfielder Cazorla and Valencia forward Paco Alcacer, Spain's top scorer in their qualifying campaign.
Manchester United midfielder Mata, Barcelona's Sergi Roberto and Villarreal's Mario Gaspar were also excluded from the defending champions' squad despite being involved in the March friendlies with Italy and Romania.
Spain will play three friendlies, against Bosnia, South Korea and Georgia before starting the defence of their title against Czech Republic on June. 13.