I'm pretty sure this is a bug.
This has happened to me twice now and the only common denominator I can think of at the moment is that a CPU controlled race completely wiped out another race, screwing up the game.
For example, I created a map with two other computer races. I was able to declare war on both of them when they both owned territory and were still alive. Fast forward many turns later after one computer has conquered another computer and I mysteriously find the declare war option grayed out.
Sometimes I would reload the save and find I could still talk to the "dead" race that didn't own anything. They didn't have any ships or planets for trade but could still trade techs. After I exited that screen and ended a turn, the diplomacy screen would finally get rid of the defeated computer. I still couldn't declare war though.
Edit: Nevermind. Just did a 1v1 against Terran Alliance and it happened around turn 401. Fast forward to turn 520 and it's still grayed out. Also had a 4 player game where Iridium Corp. and Drengin Empire also had the grayed out option. It doesn't seem restricted to Drengin.