A familiar story not limited to just software developers!
Rudy, you're a quite right in your analysis and it is telling that you can only provide 1 route out of the 3 described that goes anywhere near providing a solution. However, it should be noted that this problem besets most industries and is not a new issue either. In the late 1980s, I worked in the technology and research department of the then public sector owned Central Electricity Generating Board here in the UK. Many a coffee-time conversation was about the crazy way in which the division recruited leading engineering, mathematics and computing graduates, often with Masters or Doctoral qualifications, on what at the time were, remarkably, above the going rate for such staff at the beginning of their careers. The problem was that the pay structure was extremely hierarchical and staff would hit the top of their grade after only a few years. The only way to get increased salary and recognition was to take on staff and/or project/service management responsibilities - roles which many staff did not aspire to, were probably over-qualified for and in many cases were totally unsuited and untrained for. Like you say this meant that they spent less and less time on what they were good at (and for which they had been specifically suited) and were so demotivated (especially as they would go from excellent performance reviews to adequate or even poor). Meanwhile their direct reports or their projects were receiving poor management. Before anyone jumps on the "that's the state sector for you" or the "that's large organisations for you" bandwagons, I have worked in public and private organisations across a host commercial, scientific, technology and engineering sectors in small, medium and large enterprises. Every single one of them exhibited this issue.