|Some reasons I could think of:|
1. If you have a planet with low numbers of defense posts, you may not want it to attack enemies on sight.
2. Further, some people try to guess your friendly codes to beam stuff off your planets.
3. Small enemy scouts may show up and if you have a ship nearby, it might be more advantageous to you to attack with your ship and try to capture them (planets do not capture ships, they keep firing until the ship dies), and if you have your planet with ATT/NUK, but your ship orbiting it doesn't have a kill or PE set to the ship that arrives, then the planet will attack the ship first. This can be useful for ships without small cloaky scouts or HYP ships to steal said ships for cloning instead of destroying them outright.
4. If the planet is too weak to take out the ship, but the enemy ship didn't know you were there, they may not have kill or PE set. This buys you a turn to scramble nearby ships to the planet to defend it against attack (if the enemy ship didn't bring clans to beam down), or to immediately take the planet back (if they DID bring clans and take over the planet). Just make sure you're always building (a) >= 15 defense posts on all your planets, or (b) don't build more than 14 factories and/or 19 mines on a planet [invisibility from Sensor Sweep mission].]
...basically, it buys you an extra turn to deny the enemy the planet/its resources, since if the planet attacked the turn the enemy arrived (and was captured), the enemy instantly has access to the resources, money, and fuel on the planet that turn, and you don't know where the ship is the next turn. This keeps the planet in your hands for one turn longer, complete with intel that the enemy ship is still there or has moved/cloaked.
5. If you're towing an out of fuel enemy ship to a Starbase to force a surrender...you probably don't want the friendly code that has your planet attack a ship out of fuel. :)
Not saying there are a lot of reasons, but there are a few.