I always wonder this when going through towns that still have buildings of the old west. The buildings are all joined together, but their heights vary slightly. Why were they built like this? Why not just build them all the same height?
Here are some examples I found with a quick search:
http://peel.library.ualberta.ca/pcimages/PC/012/web/PC012554.jpg
Each property owner had his/her own idea of what purpose the building would serve and a different budget to make it happen. They may appear to share walls, but they did not. They are built wall to wall, but they usually did not share a wall. And they were tightly packed like this because most people did not own horses, but instead walked to work, shopping, entertainment, and church. I discuss this is my bookVirginia City: Secrets of a Western Past (2012).
Note that buildings were also often "false fronted"
As in any other town or city of the time, the buildings were built at different times, by different owners, for different purposes.