As best I’ve been able to discern it, Musk said he was going to buy Twitter for a way overvalued sum ($44bn) as a troll? But ended up getting in so deep that he found himself with a legal obligation to buy the thing for an absurd price.
It’s the explanation that makes the most sense to me: obscenely rich man is very used to doing whatever the hell he wants with no repercussions, particularly when shitposting on Twitter (see: SEC) and there was no-one around to tell him to stop.