Okay, Lets say 3 adventurers have recently lost their rogue in a dungeon, they wander into town and put up a sign "Skilled Adventurer Required, apply within" and they have 2 applicants, a Cloistered Cleric and a Rogue. Lets weigh up the possibilities.
- Straight off the bat, Attributes, the Rogue has Dex, Con and Int for skillpoints. The Cleric has Wis, Con and Int for skillpoints. So they're equal when it comes to MAD/SAD.
- Hitpoints. Both have a D6 and both have about the same need for Con.
- BAB - Rogue has Moderate - Cleric has poor
- Skills - Rogue has all the skills you'd want in a rogue, shockingly - Cleric lacks some skills but is more flexible as some domains grant skills and spells can replace skills entirely.
- Skillpoints - Rogue's 8+int vs Cloistered Clerics 6+int
- Saves - Rogues Reflex and high Dex with evasion gives him 1 amazing save. Clerics high Wis and Will and Fort saves make him amazing at one and solid at a second. (generally the more important saves too.
- Class Features: Rogue - Sneak attack, Trapfinding, Evasion, Uncanny dodge are all solid. Cleric - Lore, Turn Undead, Domains and Spellcasting
So there's not really too much in it until you consider the spellcasting. As others have stated there's plenty of ways to gain sneak attack through items, spells and feats... there's no way to gain T1 spellcasting for the rogue through similar means. The Cleric can copy the Rogue, the Rogue cannot copy the Cleric. "But what about UMD" - Well the Cleric can UMD almost any Divine item without a UMD check, and there are ways of getting it as a class skill but they're awkward. The Rogue is an excellent UMD'er however UMD is not as powerful as T1 spellcasting and if the Cleric really wants it, he can get it as well. Not to mention all those wands and scrolls you buy to copy someone else puts you behind their WBL.
Sneak attacks aren't even guarenteed every combat... if you roll a 1 for initiative, fail to get into a flanking position and are unable to flat-foot your opponent for some reason... you're doing basically nothing. If the Cleric fails his initiative, puts himself in an awkward position and is unable to hit his foes (high SR Golem or something) he can still DO something, like summon a monster or buff an ally.
The Cleric can also bridge the various gaps above. The Kobold domain adds disable device, search and trapfinding to the cloistered cleric, also having awesome spells. He can supplement his poor bab to good bab and overtake the rogue with spells like divine power. Where the rogue can base his attacks off dex with weapon finesse or ranged weaponry the Cleric can base ranged attacks off wis with zen archery.
A rogue hidden in the shadows can snipe at a massive hide penalty... a cleric hidden in the shadows can buff and cast indirect spells and remain hidden.
A cleric cannot do this all in one build however and will need to specialise to a degree. A Zen Archery Cleric would not be able to replace a flanking rogue. If your party has a melee who benefits from having a flanker then a flanking rogue is very nice. A straight Cloistered Cleric will have a hard time keeping up with a Rogue in a flanking melee. A Persisted Divine Power'd Cleric who's also got sneak attack from items / feats / spells however will trash that Rogue comparatively. If Persist is TO for you, then imagine a Cleric who spends his first turn casting Divine power and moving to position, then his second charging into a flank... not TO at all and will still be just as effective.
Back to our example.
The party weigh up the two applicants...
Both can find and disable traps, both have reasonable hitpoints, light armour, capable in their chosen form of combat.
The Rogue seems quick with his high dex, uncanny dodge and evasion.
The Cleric seems useful with his ability to turn undead and Lore skills.
The spells and intervention of a Cleric's deity seem to beat out the rogues ability to make situationally deadly attacks against enemies as long as they're not immune.
Addendum: If your DM doesn't use traps and you just need a skillmonkey, the Cleric packs all the knowledges without using any ranks and has 6+int on top of that... not needing trapfinding frees up a domain.
For the Rogue? Well... he can swap out trapfinding for an ACF...
TL:DR I'm completely biased and I really like the Cloistered Cleric with Kobold domain combination and I believe it effectively replaces a rogue without losing anything significant.