There are all sorts of reasons to require mediation, the most important being that experience shows it works. Once parties are in the room they typically participate in good faith, whether they showed up through mutual agreement or external requirement. And the statistics show little difference in success rates between compulsory and voluntary programs.
Mediators are usually paid by the parties in mandatory programs. While that might seem to present problems, once again, experience shows it does not. Parties share the cost and that cost is typically far, far less than the cost of litigation. Often pro bono or reduced fee counsel can be found for cases where a party has limited resources.