Prandelli's men went into the fixture full of confidence after beating England 2-1 in their opening Group D game, a win earned by a professional display in Manaus.
However, things did not go to plan in Recife and the 2006 champions are now in serious danger of not qualifying for the knockout phase.
Bryan Ruiz headed in the match's only goal just before the break, but the dynamic Costa Rica never looked like losing as Italy appeared completely bereft of creativity in the second half.
The result, which also eliminates England from the competition following their 2-1 defeat to Uruguay on Thursday, was fair - according to Prandelli.
"It was a defeat where Costa Rica were much more aggressive and played with passion," he told RAI Sport.
"We already knew this was a particularly tough group and that we'd have to gamble our qualification in the last game with Uruguay.
"If we had scored, then perhaps it would've been a different game, but we deserved this defeat.
"I don't know if we were superficial and it would be a huge mistake if we were. The players ran hard and in these conditions gave all they had.
"We had a plan, but Costa Rica were smart to close down every gap for the passes to go through."
Italy play Uruguay next on Tuesday, with the two sides battling it out for the second qualification spot.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.