Before elevators:
The ground floor was most desirable. Less distance to walk upstairs. Upper floors were considered for poor people, because they had to climb more.
After elevators:
The upper floors are most desirable. "View" becomes an important factor when selling real estate. Since the distance to climb is no longer a factor, what you can see out of the windows of your apartment replaces that. The rich no longer want to look at a brick wall, they want a view of the city, and they are willing to pay for it, (since they don't have to climb a damned mountain to see that panoramic view)