I think that a city-planet would be hard to come up with as a solitary idea and convince different nations/worlds to cooperate in building it, since it would most likely be such a huge undertaking, it would have no precedent. Trading and travelling can be done without a huge construct like that, so there would be no reason to come up with the idea. However, people didn't come up with the idea of building each major city in history, it pretty much happens cumulatively.
A possible, in my opinion, origin for such a city-planet would be one that circumvents the need for deliberate planning and cooperation, such as the following:
In the beginning there was trade
You have multiple worlds across lots of star systems with interstellar travel fast and practical enough for trade and casual travel (much like Star Wars, which had Coruscant). There are various space bases and trading posts across intermediate star systems, orbiting planets usually but sometimes oribiting the local star directly, due to practicality or choice by the owner to build it there.
Trade routes pass more often through certain systems than others. In fact, at some relatively distant point in the past, most routes go through a specific star system with multiple bases due to how much trade and travel goes through it. The system is so popular because it stands between large clusters of star systems and thus it forms a convenient trade route to other large clusters due to low amounts of celestial bodies (asteroid fields etc.) and is the safe and common path for trade. The popularity of this system as a trade node and passage point attracts trade through itself from neighboring systems and alternative routes.
Everyone puts their eggs in one basket
As time goes on, the bases are going to naturally grow and expand - they might be privately owned and operated or operated by states, but it's irrelevant - their holders compete to attract more trade and travel through their own station/base. Some people work there, so there's some dwelling accomodations. Trade cooperation happens and some bases decide to merge for mutual profit - smaller owners can't compete, so they merge to stay in the market, larger owners subsidize trade through them and welcome the new additions to their own base, which gives them more capacity and a share of the profits of others.
Considering that there's lots of different worlds moving in and out and a lot of transactions happening, as the bases coagulate into a single main one, there is political and social interest in regulating it. If it is such an important node to the entirety of a huge number of star systems and worlds, there is mutual interest to keep it running and grow it. So it grows in the same way as before. Private owners attach their own expansions, some for dwellings, some for shops, some for products, others for depots and craft maintenance. To keep everyone satisfied, a sort of representative body is established to handle administrative matters. Due to social structures on the worlds using the station, a cellular political structure, based on voting and station section hierarchies is established.
The biggest space bar in the universe
The station grows, until it is so massive, it's the size of a small moon. Give it a few thousand years and in the intermediate time, it has been slowly moved out of its parent planet's orbit (if it orbited a planet in the first place) and is now as big as an earth-like planet, orbiting the star of the system. It becomes the center of political and economical matters since it is effectively neutral ground and all trade routes go through it (or most at least). People are born and die on it, it has enough mass to have regular gravity on its surface (although by this point, generating and regulating gravity technologically is probably to be expected) and it is, for all practical purposes, considered a planet.
Have you been reading the funny pages again kid?
Assuming you have multiple worlds across multiple systems, the material isn't hard to find if there is enough mining. You don't need to strip planets clean - there's lots of ore and metals available on space rocks, clustered conveniently in asteroid fields. A bit of this from all the systems would easily allow for enough high quality material and mass to create a planet-sized body. And there you have it: Coruscant :P
Noone needed to come up with it - it just happens given time, fast enough travel and enough star systems with their own trade structure. It has a hybrid government to manage it, slowly growing out of small practical needs. It was never the best idea out of many - it's just the best option now, since it's already there.