I've been in a company where I stopped writing code — and I found that I just couldn't keep up. I couldn't participate in architectural discussions, couldn't form opinions based solely on what other people told me. Worst of all, I started losing interest.
These days I strive for a healthy balance. It certainly doesn't make sense for a CTO to write code that is needed in production right now, because other duties might make him unavailable anytime. But prototyping, testing new solutions, writing proof-of-concept code, trying out a major refactoring just to see if it works — these things make sense and they allow a CTO to both perform his regular duties and keep in touch with code/technology.