Not necessarily true. You have to challenge it to find out if it's enforceable in many scenarios, and it might act as a deterrent as well. Even a widely known unenforceable clause can deter someone who doesn't previously know that it is unenforceable from doing the action that the clause prohibits. So I can definitely see plenty of reasons to include these types of things in a contract. Plus, what does it cost them to include it in the contract?
Well if the clause is not to take them to court, and they want to take them to court, then yes they do want to go to court to find out. But I do see your point.