There are two issues here: the viewfinder and the rangefinder.
Originally, the viewfinder window was separate from the rangefinder windows and it was also closer to the center of the lens. Here you see a Leica IIIf that shows this:
https://www.cameraquest.com/3frdst.htm
When using a rangefinder to focus, a reflected and offset image is made coincident with a straight-ahead image. The further away that offset is, the base, the more accurate the focusing. So, ideally, the rangefinder's windows on the camera should be as far apart as possible (German rangefinders on WWI ships had a base of at least 3 meters).
When rangefinders and viewfinders were combined, the logical thing to do was move the viewfinder to the end, away from the lens.