I agree with this, but I would take it a bit further so that it affects multiplayer as well. The player should have an AI active for themselves, just like any other leader, except it wouldn't make anything happen. All it would do is measure your friendliness with other nations, to represent the citizens of your nation. Whatever other nations have done to or with you would affect the friendliness level. If they have been very friendly with you, and then you attack them, it will make your citizens unhappy. It would be like if the US attacked Canada or the UK. We've been good friends with them for a long time. Unless they do something very serious to provoke an attack, it would make the population very angry to be at war with them.
"You declared war on a friend!" +2
if your status with them was pleased, +4
if your status with them was friendly.
"You declared war on an enemy!" +1
if your status with them was annoyed, +2
if your status with them was furious.
The happiness penalties or bonuses should last until 10 turns after the war ends. Neither of them should stack. When you go into the foreign relations screen, you should also be able to see how your citizens feel about the other countries.
Similar to how it affects your citizens, it should also affect your diplomacy. If you attack your allies, the computer players should view you as a backstabber. "You can't be trusted."
-1 if you attacked someone you were pleased with, "You stab your friends in the back!"
-2 if you attacked someone you were friendly with. Because of the changes above, this would also have an impact on multiplayer games, since this would make the citizens of other countries more willing to see you attacked.
Finally, to help out good allies, and peacemongers, there should be a bonus for helping out allies by declaring war on people who declare war on them. "You came to the aid of a friend!" +1
if you were pleased with them, +2
if you were friendly with them. This should also last until 10 turns after the war ends.
The AI would obviously need to be designed to work around this, so that it behaves in a manner that will help keep its citizens and allies happy. Likewise, this should change the backstabbing, warmongering strategies that so many people use.