That is not correct. First of all, no visas will be given if you say you are coming for the sole purpose of giving birth, unless you have a special kind of high rissk pregnancy and are going to be seen by a special US doctor who handle this type of high risk birth. I had a relative who was able to get a visa for this express purpose.
Birth tourism is not a legal practice in theUS. If it were, the feds would not be raiding maternity hotels.
Birth tourism is legal. They raided the maternity hotels but they can't arrest anyone unless they broke the law by committing visa fraud, tax fraud, medical fraud, run out on bills etc. If immigration ask you, you are suppose to tell them the truth if you are pregnant and want to give birth in the US. That is not a crime. You are then supposed to show documentation that you have the means to pay for your medical treatment. People go to the US all the time for medical treatment which is allowed as long as you have the means to pay for it.
A B2 visa should cover a person for most things including getting medical treatment.
From the U.S. VISAS U.S. Department of State • Bureau of Consular Affairs website
Pleasure, Tourism, Medical Treatment - Visitor Visas (B-2) If the purpose of the planned travel is recreational in nature, including tourism, visiting friends or relatives, rest, or is related to medical treatment, activities of a fraternal, social, or service nature, or participation by amateurs who will receive no remuneration in musical, sports and similar events or contests, then a visitor visa (B-2) would be the appropriate type of visa for the travel. Persons planning to travel to the United States for a different purpose including students, temporary workers, crew members, or journalists, must apply for a different category of visa. You will find additional information on B-2 requirements on travel.state.gov
From the US Customs & Protection website
Can I visit the U.S. while pregnant and what are the risks involved?
Although there are no specific regulations prohibiting pregnant foreign nationals from entering the U.S., entry is allowed or denied at the discretion of the admitting U.S. Customs and Border Protection (CBP) Officer. If the CBP Officer determines that you are likely to become a ward of the government (meaning that the government must provide medical care because you do not have medical coverage), you can be denied entry.
When determining if you will be allowed to enter the U.S., CBP Officers take into consideration the date your child is due for delivery and the length of time you intend to stay in the U.S. In addition, they want evidence that you have sufficient medical insurance to cover any medical necessities while you are in the U.S. and that you intend to return home.
If it is determined that you do not have sufficient medical insurance to cover any unexpected or expected medical care while in the U.S., you can be denied entry. Additionally, if you are pregnant and entering the U.S. at a border port of entry via vehicle, be aware the radiation detection portals deployed at the ports do not emit any radiation, and do not present a hazard to you and your unborn child.