The Croatians finished third in Group C on four points, with Spain (seven) and Italy (five) reaching the quarter-finals.
A late goal from Jesus Navas secured victory for Spain although the European and world champions were pushed all the way by Croatia.
Midfielder Ivan Rakitic has the best chance of a tense and tight game but his close-range header just before the hour was brilliantly saved by Iker Casillas.
Rakitic told reporters he would now have "several sleepless nights" because of the miss.
"We came here to go all the way and we failed because we lacked that tiny bit of luck that makes all the difference," Bilic said.
"We knew we would have two or three chances and we had the one with Rakitic and when you get a chance like that you have to take it."
Bilic said Croatia should have been awarded two penalties but Spain enjoyed "permanent help from the referee in those little details".
Croatia would now, Bilic said, head home "with our heads held high".
"This was a really difficult group and we are proud of what we did," he said.
"We can go back home with our heads held high. To play against Spain is really tough. They are such a tactical team."
Despite being tough opponents, Bilic said he believed Spain could struggle to retain their title.
"I don't see them as the really big favourites," he said. "There are quite a few teams that maybe have more pace and are hungry to win and maybe more aggressive on the pitch than Spain."
Bilic now heads off for a new challenge after agreeing to take charge of Russian Premier League club Lokomotiv Moscow.
"I didn't expect this would be my last match," he lamented.
"I was sure we would go through because we are a good team. My players are just phenomenal.
"I am not going to make a big speech, it's not my style."
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.