Is this like some sort of weird reverse projection, where one takes someone else's desirable traits, and associates them with oneself?
Yes, it's their other projection.
They accuse their perceived enemies of what they do, and attribute to themselves, the virtues ethics and morals of those perceived enemies at the same time.
One might call it reality swapping.