If you can find no one else who could do it then of course they shouldn't be fired. If you can find another programmer who can do it as well and have it also be maintainable then fire the original guy immediately. Lack of maintainability incurs a risk and a cost on businesses so unless they are adding enough value to make it worth it (as the person in your example is) then they probably should be fired