The AI is a bit stupid at the moment.
I hope to somewhat rectify this in the medium-term.
You're right, it's often best to upgrade the planets with the lowest production. I haven't yet given a lot of thought to what would happen if the production increase was tied to the planet size; no doubt I should.