In your example you've said the EU "wants to" impose immigration quotas and "fine the countries that don't accept". How is that different from e.g. Germany imposing an immigration quota on your country? In exchange of e.g. not leaving you out of a trade agreement.
What's stopping your politicians from negotiating those quotas? Nothing, because that's what they're actually doing, but they know part of their voters are xenophobic, so they have to save face by saying "the EU told me to do it". It's politics 101.
Finally, please point me to where the EU is not a democratic entity, because I think I've missed the memo.