To elaborate a bit on what Mulhorand Sage said:
Riley wasn't sleeping with vampire hookers; the vampires would feed off humans in exchange for money, which would give the humans a high. Although it's fair to say Riley was cheating on Buffy, they both recognized that the problem between them was that Buffy didn't really open up to him or ever really count on him for support or anything. She never needed him for anything. Joss said that Riley was supposed to be the nice guy boyfriend who Buffy just walks all over.
When she finds out Riley's cheated on her, Buffy isn't sure what to do. Riley tells her that the military wants him back, and that he wants to go, but he'd rather stay with her, and he'll stay if she asks him to. After talking with Xander, Buffy realizes that she wants to give Riley another chance, and goes after Riley. She's too late, though, and Riley leaves. When Buffy does see Riley again, he's married.