1. The Colony Capital isn't the same as the Civilization Capital - each planet has a Colony Capital (much like how each country on Earth has a Capital City).
2. That's tile is just the first one it selects (which is why it puts the Colony Capital there), so when you try and build a terraforming improvement on a high-quality, it can't find a place to put it and just defaults there. I agree that Terraforming should be grayed out if they can not be built.