I am little bit confussed by AI building of a new planets. Every single planet in a home system builds spaceports !
As I understand it is somehow related to two separate entries for spaceport abilities: "spaceport" and "emergency energy". the first is listed in homeworld description, the second in all other colony types. PvK, can you please look on this problem ?
The easiest and fastest way to solve this is to give spaceport some small production/research, so AI won't waste this planetary slot completely.