Hi! Congratulations on getting an interview! This actually also happened to me when I was applying to McKinsey as a candidate.
As fellow experts have pointed out, it could be a combination of things - your first choice office could have rejected you, your second choice office could have felt you were a better fit, or they could have felt that you were a strong candidate but your first choice office was oversubscribed. If your first choice office and your second choice office are in different countries, it could also have to do with various immigration restrictions.
Depending on how strongly you would prefer to be in your first choice office, there may be some opportunities for changing offices down the line if you end up joining McKinsey. I ended up sticking to my second choice office and loved it there, but I had plenty of colleagues who moved and were supported by McKinsey in their office transition. It's not the easiest process and you usually would need to have at least 1-2 years to achieve a transition, but it can be done.
If your location preference has more to do with an interest in working in particular industries or with particular clients, you should be able to do such work regardless of your office location since McKinsey doesn't employ a home-office model. Be sure to discuss such interests with your staffing manager.
Feel free to message me if you want more details about this, and best of luck in navigating the recruiting process with McKinsey!