Safety regulations, ergonomics, cost.
Having an engine compartment in front gives you a crush zone that's useful for something other than being crushed. While you could put a windshield further forward over the engine, that still doesn't help visibility all that much (and move it too far forward and you'll have to wrap it into the roof so drivers can see overhead traffic lights), with the engine there... and it gives you much more cabin to build and an unusually large greenhouse, which means bad things for the AC. This all puts a practical limit on how far forward you can move it.
Move the engine to the back and you can design a better front end.
But a lot of people "don't feel safe" with a blunt-nosed car. Hence, even small cars today need massive proboscises to convince people they'll survive smashing head on into an eighteen-wheeler at 120 mph.
And whatever happens up front, the rear end will always suffer due to the need for rear passenger space and/or/maybe? cargo.