It is illegal for the same reason that the big banks and GM got bailed out, and Sony can install a virus on your computer without (significant) legal consequences ...
Governments all around the world have taken on larger roles within the economy (sold to people by convincing them that they're "helping" them or "helping the poor") and this power is heavily used to protect the interests of those people who have money or power.







