Building solar panel installations in remote locations still requires linking that back to the main grid, and all the in-between infrastructure needed to transform and transmit that power. Building it in an urban location allows you to tap into the existing grid without much added public investment, similar to how some power grids will purchase power from homeowners as an added incentive for doing a home solar install.
Right, they actually have siting advantages over ground mounts for that very reason.
And let's not forget that they are investments, not just stranded costs (it's baffling to see them discussed that way to and down the thread). You get something back for having built them and the barrier to entry is the upfront cost, which is easier to overcome if you're a state spending on infrastructure.