(This reply overlaps with Cowford's, which appeared while I was writing, but may be a useful supplement.)
I think the motivation was that you needed the crew (well, at least part of the crew: the fireman) between the tender and the boiler to shovel the coal from from the tender into the boiler's firebox. Even when, as with most large locomotives after about the time of the First World War (in the U.S.: British and European railways didn't use automatic stokers to the same degree) the locomotive had machinery to move the coal, the fireman had to be there to keep an eye on things (and maybe put a bit of coal in by hand if the fire was uneven). It would be possible to have the fireman there and the engineer in a separate cab closer to the front: this was done on the "Camelback" or "Mother Hubbard" type steam locomotives used by number of Eastern U.S. railroads in the late 1800s-early 1900s. (These railroads used anthracite coal, which required a very large firebox, so the problem of seeing around the boiler had the engineer been in the usual place would have been even worse than usual.) This, however, had its own disadvantages: engineer and fireman ought to be able keep an eye on and communicate with each other, and it was standard practice for the fireman to interrupt his shovelling to look out the window for things on the side the engineer couldn't see from his: the Camelback design was, therefore, seen as a safety hazard, and was banned (from new construction-- railroads that already had Camelbacks were allowed to continue using them, and some did until the end of steam) by about the 1920s.
The Southern Pacific's "Cab Forward" (or, colloquially, "Back-up") locomotives shown in the (very nice--thanks!) clip MEC407 linked to are "exceptions that prove the rule": they were oil-burning locomotives. Southern Pacific had one class of coal-burning 2-8-8-4 locomotives (SP's huge system had areas where using coal fuel made more economic sense than oil), similar in general size to their later Cab Forwards, and these had the cab in the "normal" location".
Remember that trains run on TRACKS: no steering to do, no variation in how far to the left or right you are driving in your "lane", oncoming traffic similarly constrained in location: among other things, this allows signals to be placed so that an engineer can see them despite the restricted field of vision. Many hood-type (road-switcher) diesels (particularly in the "first generation" of dieselization in the late 1940s and 1950s, but much later than that on some railroads) were often operated long-hood-forward: visibility no worse than on standard steam locomotives, and it was felt that the crew would be slightly safer if the whole engine compartment was between them and the idiot auto drivers who try to beat a train to a grade crossing.