For starters, see this thread.
My understanding is that the ancient predecessors of mitochondria were free-living unicellular organisms. Supposedly at one point, these mitochondria-like cells developed an endosymbiotic relationship with a larger cell. This relationship was advantageous for both cells: the smaller cell could focus on energy production, leaving tasks like homeostasis, nutrient collection, etc, to the larger cell. Over evolutionary time, this endosymbiosis caused the smaller cell to lose all functions unrelated to energy production, while the larger cell (as we now know it) came to rely heavily on the mitochondria for energy production.
So it's possible that at one time the nucleus encoded machinery for ATP production, but apparently the modularity and separation of function provided by this ancient symbiosis turned out to be successful.