Costa, 27, was sent off during his club's 2-0 FA Cup quarter-final defeat at Everton last week, ruling him out of Saturday's game with West Ham.
Chelsea boss Guus Hiddink said on Friday that Costa has a problem with a tendon in a hip muscle.
Spain are away to Italy in Udine on 24 March before facing Romania in Cluj three days later.
Athletic Bilbao forward Aritz Aduriz, 35, has replaced Costa as Vicente del Bosque's squad build-up to this summer's European Championships in France.
Aduriz has scored 17 goals in 28 La Liga games this season.
The Spain squad features six Premier League players.
Manchester United goalkeeper David de Gea and midfielder Juan Mata are included along with three Chelsea players - defender Cesar Azpilicueta, midfielder Cesc Fabregas and winger Pedro.
Manchester City midfielder David Silva is also named.
Goalkeepers: Iker Casillas (Porto), David de Gea (Manchester  United), Sergio Rico (Sevilla).
Defenders: Jordi Alba, Gerard Pique, Marc Bartra (all Barcelona), Sergio Ramos, Nacho (both Real Madrid), Cesar Azpilicueta (Chelsea), Juanfran (Atletico Madrid), Mario Gaspar (Villarreal).
Midfielders: Sergio Busquets, Sergi Roberto (both Barcelona), David Silva (Manchester City), Mikel San Jose (Athletic Bilbao), Koke (Atletico Madrid), Cesc Fabregas (Chelsea), Thiago Alcantara (Bayern Munich), Isco (Real Madrid), Juan Mata (Manchester United).
Forwards: Pedro Rodriguez (Chelsea), Alvaro Morata (Juventus), Aritz Aduriz (Athletic Bilbao), Paco Alcacer (Valencia), Nolito (Celta Vigo).

The Nobel Peace Prize laureate and anti-apartheid campaigner said that he did "not wish to be kept alive at all costs", writing in the Washington Post newspaper on his 85th birthday.
Mr Tutu came out in favour of assisted dying in 2014, without specifying if he personally wanted to have the choice.
He was hospitalised last month for surgery to treat recurring infections.
"I hope I am treated with compassion and allowed to pass on to the next phase of life's journey in the manner of my choice," Mr Tutu wrote.
"Regardless of what you might choose for yourself, why should you deny others the right to make this choice?
"For those suffering unbearably and coming to the end of their lives, merely knowing that an assisted death is open to them can provide immeasurable comfort."
There is no specific legislation in South Africa governing assisted dying.
But in a landmark ruling in April 2015, a South African court granted a terminally ill man the right to die, prompting calls for a clarification of the laws in cases of assisted death.
The Anglican Church - of which Mr Tutu is a member - is staunchly against assisted dying.
This is not the first time Mr Tutu has come out against the church, however.
He is an outspoken supporter of gay rights, and has openly criticised conservative Christian attitudes to homosexuality. In 2013, he said would "refuse to go to a homophobic heaven" in favour of "the other place".
At the time, he added: "I would not worship a God who is homophobic and that is how deeply I feel about this."
Earlier this year, he blessed his daughter Mpho's marriage with her female partner, despite South African Anglican law on marriage stating that "holy matrimony is the lifelong and exclusive union between one man and one woman".
The then-Archbishop of Cape Town also controversially supported an amendment to make abortion more readily available in South Africa in the mid-90s, despite some personal reservations.
Desmond Tutu:
Profile: Archbishop Desmond Tutu
Archbishop Tutu in his own words
Chelsea striker Diego Costa has been left out of Spain's squad for friendlies against Italy and Romania.
[NEXT_CONCEPT]
South Africa's Archbishop Desmond Tutu has revealed that he wants to have the option of an assisted death.