Yup. It took me a long time to realize and accept this. I love Boyds quote on this (w.r.t working in the Airforce burecracy) "You have to make a choice - you can be somebody or you can do something."
By the way the same thing happened to me. I wasnt trying to fire him though, just tried to make him get better. He was really bad. He ended up getting a raise from my boss. Funny!
I say trying to fire him, but that is really more what I considered to be an almost forgone conclusion. Everybody on the team was sick of needing to pick up the pieces he dropped. Just like any company, we had to go through an attempt document him formally trying to improve to get to the point we could let him go.
So I did. I gave him a plan that he had to live up to. It was non-trivial, since he was a senior engineer making more money than almost anybody the engineering team, but it was doable.
My boss then made the mistake of moving him to a different manager to follow through with the plan. The goal was to show that we weren't just out for blood, but throwing somebody into a new environment (new team, new project, new coworkers) creates too many variables to track. On top of that, this engineer survived by hiding in those variables (and we knew that) and, as a result, was able to survive what would most likely have resulted in termination under me. Since he survived, my reputation with the engineering group was blown.
Quite literally, this guy was Dilbert's Wally. Six months later, the new manager was lamenting to me about this guy.
Lest it sound like I just have a grudge, I actually like the guy (even though I know he really doesn't like me). He is actually a really great people-person that, IMO, shouldn't be writing code. I really believe he should be a sales engineer. I think he would make a near-perfect sales engineer, in fact. I gave him that advice, but he didn't appreciate it. I don't blame him, but I stand by it.
I had another guy who was in this situation that you describe above. He actually used to be my boss before I became his.
Made more than me. His code was crazy bad. I mean I think he used to obfuscate it on purpose so as to keep his job. Every class was a friend of another class. But the code would work. It was a nightmare to maintain.
I was asked by senior management several times to get rid of him. I just kept thinking of his kids. I knew I couldnt live with myself if I did it. Because his intent was always good and he would do work that no one else wanted to do.
If I had to keep him for another year, I might have pulled the trigger - but I doubt it.
If it was my own startup I would have fired him immediately. You probably did the right thing.
John Boyd was one of the greatest strategist of the modern military era. In this case he was talking about working for a promotion versus working towards making the airforce better.
By the way the same thing happened to me. I wasnt trying to fire him though, just tried to make him get better. He was really bad. He ended up getting a raise from my boss. Funny!