Upvote:4
I assume you are a US citizen, based on your statement that you will fly "back to the US."
Because you are a citizen of a visa-exempt country, you should be able to enter on the date of your visa's expiration. Time spent in Spain on a Spanish long-term visa or residence permit does not count toward the 90-day total. Therefore, you should also not be refused entry to Greece for overstaying.