A considerable portion of American and other Western spy movies depict these things negatively, focusing on things corruption or the idea that the West and USSR are morally equivalent, and the CIA/MI6 are just the same or just as bad as the KGB.
I am thinking of things like John le Carré's writing, which has been made into numerous films, and is described by Wikipedia as "portray[ing] British Intelligence agents as unheroic political functionaries aware of the moral ambiguity of their work." The entire Bourne series is about rogue and out of control CIA operations. In "Spy Game" the CIA wants to let an operative rot in a Chinese prison to avoid upsetting politics. In "Enemy of the State", NSA agents are trying to kill a congressman.
There are of course plenty, probably a majority, of movies that depict Western spies heroically (the entire James Bond series, for one), but there is a significant chunk of movies that do not.
Is there any similar tradition of spy movies in Soviet and Russian cinema that portray the KGB/FSB negatively, and how did their depiction change, if at all, between the USSR and in Russia in the 1990s after the breakup of the USSR?
There is always more to say on the subject, but I would recommend this answer by u/Volens_Nolens as a place to start.
Specifically for the Soviet period, the focus of novels and films (usually based on those novels) was often either the Second World War (as in the wildly popular 17 Moments of Spring and The Sword and the Shield), or more contemporary domestic counter intelligence (rather than foreign intelligence).
As for the 1990s-to-2002, I'd say there's not really a whole lot more there to add. The 1990s (because of the general economic collapse) were not easy on Russian film-making, and the films that did get produced tended to either be very weirdly experimental (and not terribly interested in now-passe things like the KGB), or focused on bigger, darker parts of Soviet history (like Burnt By The Sun, which I guess has some connections to the KGB's Stalin-era antecedent), or were popular films focused on gangsters, a la Brother (which again kinda sorta indirectly deals with the fallout of the collapse on uniformed services like the KGB in that lots of them turned to organized crime, as in this film, although here the protagonist is a Chechnya military vet). Actually it just makes the 2002 cut-off, but a more directly related example of the latter is 2002's Brigada (aka "The Brigade", more or less like a Mafia crew), as the main character leaves the Soviet Border Troops (which were controlled by the KGB) and joins an organized crime racket.