It matters to war-weariness and sometimes to reputations (if deals are being broken) who declares a war.
In terms of tactical advantage, I think it's not so much who declares war that matters, but who gets to move first.
The best situation is probably the one created when you say "Get out or declare war" and they declare war. Because you get first crack at them, but they're the aggressor, which helps your war-weariness, and they're the deal-breaker.
The problem with the spy-angering gambit is that the AI might get furious, but wait to declare war in its time rather than immediately.
Now, the AI usually isn't very good at exploiting first-mover advantage (it spreads out its attacks too much - it'll try and fail to take two different targets, when it could have succeeded in a concentrated attack on one.) But when it's strong it can still do a lot of damage and take the initiative.
I don't like to goad the AI into starting a war if it does so in a way that leaves me reacting to its moves, unless I'm so much stronger that it doesn't matter.
Clean wars don't necessarily hurt your chances of a diplo victory, if you can control alliances. The war-related attitude calculations, except for the "trustworthiness" ones to do with credit and ROP's, are mostly just between combatants. You're not going to get a vote from someone who's rubber you steal, of course, but you knew that already
There's fun to be had in situations where you've tried to play a clean, friendly game with diplo victory in mind, and some other civ grabs the U.N. ahead of you. Often, if you've been making nicey-nice all game, you've probably gotten a little behind the front-runners in power (and sometimes tech), so you might not even be a candidate in the early votes, unless you can kit yourself out with nukes in a big hurry.
The challenge becomes taking that U.N. city from whoever built it, and taking it fast enough so that there's no conclusive vote until you're a candidate (and can win), but without relying on alliances that can spiral out of control and ruin your popularity.
Since the UN-building AI may very well have postured itself for a diplo win (usually with the dead-men-can't-vote policy), it can get interesting.