It’s amazing how easily assumptions become myths.
Carburetors are not and have never been illegal, but as already mentioned it’s pretty much impossible to meet modern EPA emissions regulations with a carburetor. A carburetor has too big a technical challenge to overcome. It metes out gasoline using a system of relatively low pressure differences, and that means the gas droplets are too big to burn through completely in the timeframe they have in an engine spinning at thousands of revolutions per minute. Since only the hydrocarbon molecules in direct contact with oxygen atoms burn, the large droplets have to burn through in layers, like the layers of an onion. There simply isn’t enough time.
Fuel injection sprays using smaller orifices and high pressures, typically 40psi and up. It creates a very fine mist, much smaller droplets, much more able to burn completely in the limited time available. And port injection sprays directly behind the intake valve, eliminating the congealing of the droplets on their way to the cylinders… they need not go through the intake manifold. In addition, since the pulsewidth and injector timing can be controlled with great precision at each cylinder, it can be metered far more accurately.
Direct injection is theoretically even better because the fuel doesn’t have to go around the intake valves, but it still has a few byproduct problems to be worked out. Time will tell if it’s really better enough to justify its added cost and carbon problems. It’s early yet.