Think of the problem in two filters: safety in pregnancy first, then convenience and cure rate.
Safety filter: the tetracyclines (tetracycline, doxycycline) are dropped at once because they deposit in fetal teeth and bone and are banned in pregnancy. Penicillin, when it appears, is irrelevant here because it does not reliably clear the intracellular Chlamydia organism. That leaves the macrolides as the safe choices.
Convenience and cure filter: erythromycin works and is safe, but the course is long and the stomach upset is bad, so women often stop it early. Azithromycin clears Chlamydia with a single 1 g dose, which is far easier to take and gives high cure rates, so guidelines name it the drug of choice whenever it is on the list.
So in the set that includes azithromycin, azithromycin wins. In the set that swaps azithromycin out for penicillin, the safe and effective remaining macrolide, erythromycin, is the answer instead.
\[\boxed{\text{Azithromycin (Erythromycin in the no-azithromycin version)}}\]