Ditto is an incredible revenge killer, able to shut down almost every choice or life orb user weak to itself, which is a surprisingly large group, and also is able to use the hidden power of its on things like raiku which don't naturally counter themselves.
Ditto is this good because of its ability to switch in and instantly transform, and steal stat boosts too. Having trouble with a +6 speed yanmega? get ditto in, and it can outspeed thanks to a choice scarf and counter yanmega with air slash. Dragon Dance kingdra wrecking your team? switch in ditto, and make use of your +1 atk/speed to outspeed kingdra with scarf and then ravage your opponent.
tl;dr Ditto is the god of revenge killing, certainly A tier, if not S tier. While it technically isn't in UU, due to its particular play style it is exactly as powerful as the tier it is in (it has its place in ubers too) so I think it should qualify for a UU ranking.