I think my point may have not been clear. I was responding to someone who offered a theory that it is legal because it reduces the cost of having trials. The implication is that it was decided at some point that we should allow it.
My point is that because it is implied by freedom of contract, it is by default legal until we decide to make it illegal.