This is very common in large acquisitions and mergers. Remember, Must didn't have to include the $1B walk-away fee. But if he didn't, then the board may have been much less likely to accept the offer.
The lawyers came up with the terms and contingencies. Once signed, you're expected to hold up your end of the deal. I'm sure the lawyers have experience with court-cases / whatnot and have the precise court-cases which led to this style of agreement... but that doesn't matter anymore.
Musk agreed to it, so it must be upheld in that manner.
The government issue and the money issue are basically the two scenarios in which Musk would be unable (not just unwilling) to complete the transaction. So that's where he has to pay the fee. Otherwise, he can't change his mind.
(I know "kill fee" isn't the right term, but that's what we'd call the equivalent in publishing!)