He is obligated to close the deal and Twitter can force him to do so. If some external force stops the deal from happening - or if he can show that Twitter egregiously violated the agreement - he can get away with not buying Twitter, but he still has to pay them $1B.
The point is that paying the ‘fine’ doesn’t give him the right to walk away for ‘no reason’. If he does he may end paying damages for much more than $1bn.