"There is a real risk that it will leave" the bloc, Jose Manuel Garcia-Margallo told reporters, according to a ministry spokesman.
"That would not be good for Europe and it would of course be very bad for the Greek people."
Talks in Brussels between Athens and its EU-IMF creditors collapsed on Sunday, leaving the country on the verge of a default.
Asian stock markets and the euro fell Monday on fears Greece could tumble out of the eurozone.
The crunch negotiations failed in their second day, raising fears the cash-starved Greek government was heading into a financial abyss with a huge IMF debt payment due at the end of the month.
EU sources accused the Greeks of intransigence while Greece accused its most hardline creditor, the International Monetary Fund, of pushing "irrational" demands for economic reforms.
Spain, which got a €41 billion ($46 billion) bailout for its banks in 2012, has joined Germany and other leading eurozone countries in taking a tough line with Greece.
They are demanding it push through further reforms, including to pensions, in order to unlock the €7.2 billion still remaining in Greece's international bailout, which expires on June 30th.
For Garcia-Margallo, the eurozone "is a club with a set of rules and whoever breaks the rules runs the risk of leaving the club," the Spanish foreign ministry spokesman told AFP.
French President Francois Hollande on Monday urged a quick restart of talks to save Greece from financial disaster.
"We are getting into a period which could be turbulent if no agreement is found," he warned.