Your first statement is factually untrue. You could say it was initially forced into existence to generate the fuel for nuclear weapons but beyond that it's way more accurate to say it has spent the last ~50 years having the utter insanity of the regulatory body overridden by large subsidies with the last 30 or so of those years having people that don't like nuclear point at the subsidy and say nuclear is uncompetitive while ignoring the massive cost and uncertainty created by the nuclear regulator. There is no real free market here, most real innovation has been utterly destroyed by the regulator driving massive uncertainty into private investment by removing any certainty of the effectiveness of a company structure containing the cost liability of problems (this is not the same as liability flowing through to management/the board for obvious dereliction of duty, this is flow through happening automatically if you don't do every stupid thing the regulator comes up with, which is mostly unecessary and highly cost additive to your project).
This has stopped any sort of commodification of reactor construction and kept every project a bespoke, highly expensive, one off. Further, throwing solar panels everywhere ignores the total cost of solar because it ignores the large ancillaries cost having a non demand resource causes so it's incorrect to compare the two directly, you need to look at total cost including ancillary costs of grid connection (which is much closer, especially when looking at asian construction costs where the regulators are much less idiotic but still excessive and where production of these bespoke installations continued so skills of the labor force were maintained).
If we get the stupidity of the regulator out of the way we could have commodity built new generator designs with drastically cheaper total costs and eventually much better technology like molten salt that should be dramatically safer and that would be a fair comparison to solar, which has had the support to commodify and drive production cost into the ground over the last thirty years and is still questionably competitive when the total cost of running including ancillary costs is included against the worst version of nuclear (what we currently have). This is starting to become a national security concern because China is going hard on these newer, better technologies and they could end up owning the market on a decade or two timescale, which is a huge strategic issue since their main achilles heal right now is energy imports.