It isn't outlawed in most places, it's just that profit-driven property developers, often building outside city limits threw up malls quickly so they could rake in the greater immediate profit from retail spaces vs housing. They'd have been permitted in most of the USA to include apartments from the start if they'd deemed it profitable enough.