Also in that link, they didn't start the testing until the 30s, and it was started primarily because of syphilis.
It's a tradition that doesn't go back all that far, and that was only secondarily about children. Note that the assumption they were making wasn't that you were getting married to have children, you were getting married to have sex.