The package includes €750bn (£673bn; $888bn) for a Covid recovery fund.
Ambassadors of the 27 member states meeting in Brussels were unable to endorse the budget because the two countries vetoed it.
The EU is currently investigating both countries for undermining the independence of courts, media and non-governmental organisations. The clause threatens to cost them billions of euros in EU funding.
EU states had already agreed on the €1.1tn budget for 2021-2027, and the coronavirus stimulus package after a marathon four-day summit in July.
The ambassadors had voted through the clause that made access to EU funds conditional on adherence to the rule of law, because it only required a qualified majority, the German EU presidency said.
But the budget and the rescue package needed unanimous support and were then blocked by Poland and Hungary.
SpaceX successfully launches first operational crewed mission
This is a row that’s come to a head after simmering for the past four months. It was back in July, when EU leaders first agreed to club together and raise almost €2tn to spend over the next seven years, as they try to recover from the financial crisis caused by Covid.
At the time, the agreement was hailed as a “magic moment” by the EU Council President Charles Michel, who said it was “unprecedented”, because access to cash would be conditional on countries following the rule of law.
But Hungary and Poland haven’t viewed the arrangement that way, and both countries have long been at loggerheads with the EU over perceived backsliding of core values.
Read more: BBC