Do you think
you can stop every under-18 teenager from experimenting with sex, and all of them doing so from falling pregnant?
I think you are missing the point. These are non-adults who are wanting to take on the adults-only responsibility of marriage. They can get dispensation at that age by demonstrating to the correct authority (which is
not their parents) they have the will and ability to do so. Many young couples are mature enough to succeed, and go onto have happy marriages and raise children. In fact, unsupported evidence suggests this is the norm in such situations here, i.e. it's usually no problem.
However this pair did not pass that simple first test, even with the incentive of a baby on the way. Which suggests very strongly that there is far more to the background story than they are telling. The impression I got from the report was this was a clear shotgun-wedding arrangement by the parents - "We is gunna go to the judge an' he's a'gonna marry yer!" Judges here do
not like being used to settle scores or as political pawns and will actively take
no part in such shenanigans...