It’s a simplification to free up the courts. Too much energy to look at every case.
Perhaps if technology improves to a certain point where it becomes simple to determine maturity then this would become more individually defined.
In context, if society does not have a welfare state perhaps marriage is not a misguided requirement, minimizing potential requirement for charity for single parent situations.
There are differences across the world and one can choose to a degree where to live if unhappy.