Convenience of infrastructure.
(Mind that the border at the time was the Danube)
Anywhere else than Belgrade, it would have been impossible at the time to build a railroad connecting a capital city to the grid of European capitals due to the hilly / mountanous land. Furthermore, a capital city on the Danube allowed steam boat access to the "big capitals" in central Europe, meaning Pest-Buda, Vienna, Passau and Munich through the Isar river.
You can read more if you hit up some books or records on the Donaudampfschiffahrtsgesellschaft. A terribly long word though an important innovation in Austria.