It's not a penalty. Nobody is saying they did anything illegal. It's an increase in liability caps. That's not the same as saying that something you did is now retroactively illegal. That's a boondogle, this isn't quite the same thing. Taxes have been retroactively changed, for example.
In addition, it seems most people I've read agree that this legislation is not likely to face any serious ex post facto constitutional claims as it is a change to existing legislation, and affects liability limits for ANY oil company (in other words, not just a punishment for BP).
Either way, it seems like a bit of hyperbole to say that retroactively increasing liability caps is the same thing as retroactively making a legal activity illegal. Not really quite the same animal, imo.