The Europe Union, which is another example of the same, illustrates quite well why it's more convenient to have the executive and legislative branches of government in one place.
The European Commission and the European Council, which are the executive branches, have their seats in Brussels. The European Parliament has its formal seat in Strasbourg. The European Court of Justice is in Luxembourg.
The European Parliament decided in 1985 to build another chamber in Brussels, in order to streamline how it works with the Commission by being closer to the latter. There was some protest when this occurred (chiefly by France). This resulted in a decision during the 1992 Council, which got enshrined in the Treaty of Amsterdam, whereby the EP must hold 12 sessions per year in Strasbourg. The rest of the time it basically sits in Brussels. This has a significant financial cost, too: MEPs end up having a travel budget so that they and their staff can hover as needed between the EP's two seats, and this is part of why it's one of the most expensive parliaments out there. (The other major reason is, of course, the need to work in a whopping 24 languages -- and that is likely there to stay.)
Insofar as I'm aware it's not as big a deal that the ECJ is in Luxembourg.
If I'm not mistaking, there's a similar dynamic in South Africa (though the other way around, with the Presidency having a subsidiary office in Tuynhuys, Cape Town), with arguments for and against there being multiple capitals nearly identical to those being used in Europe. Per the wiki article on its Parliament:
Parliament sits in Cape Town, even though the seat of government is in Pretoria. This dates back to the foundation of the Union, when there was disagreement among the four provinces as to which city would be the national capital. As a compromise, Cape Town was designated the legislative capital, Bloemfontein the judicial capital, and Pretoria the administrative capital. The African National Congress (ANC) government has proposed moving Parliament to Pretoria, arguing that the present arrangement is cumbersome as ministers, civil servants and diplomats must move back and forth when Parliament is in session.
However, many Capetonians have spoken out against such a move, accusing the ANC of trying to centralise power. Under the Constitution, there is provision for Parliament to sit elsewhere than Cape Town on grounds of public interest, security or convenience and Parliament is permitted to provide in its rules and orders for sittings outside Cape Town.