And not only is it strange to keep all the keys to the planet's security in one place, but it seems even stranger to entrust them to a guy who's job is to charge brain-first into an unknown cosmos so definitely filled with brain slugs. And there's not even a plan in place for when those codes are compromised. Once the codes are entered, everyone on Earth is powerless to do anything but watch Nero drill the planet into bits.
"We need to reset the password! Who remembers what we put in for Earth's first pet!?"
The Earth isn't that defenseless now, let alone 200 years in the future. If Nero showed up today, we have tanks, nuclear weapons, drones, guns, and ... uh ... several hundred types of karate? In Star Trek, it's all the responsibility of a few starships (which are all away on missions) and this stupid defense system. Your debit card right now has better security than the entire planet in the 23rd century.