The answer is status. Most developers are (despite being comparatively well-paid) quite low-status: people tell them what to do all the time and they are expected to comply. By contrast CEO is pretty much the top of the status pole. It is natural for human beings to crave status so it is natural to dream about being CEO even if most won't particularly enjoy it.