The reason that genes for potentially lethal genetic disorders are still present is the fact that many of them are, as you noted, recessive. This means that they can remain buried for many generations. Do a Punnett square for any recessive disease
D d D d
D DD Dd D DD Dd
d Dd dd D DD Dd
In both punnett squares half of the offspring are healthy carriers if one or both parents are healthy carriers. In this way a genetic disorder can remain hidden for thousands of generations, then suddenly pop-up from nowhere.
This is also how Hemophilia got into the royal families of Europe. Queen Victoria, and inevitably many of her ancestors, was a healthy carrier of the hemophilia Gene. She had many daughters, who all married the heirs to the other European throne. All her daughters were also healthy carriers, so when they bore male children, they had hemophilia.