dying does not equal died. Joyce was ill. Very ill.
Xander regularly judges Buffy's choices. In the past Xander's had some big issues with Buffy trusting her feelings. And Buffy regularly doubts herself. Xander suggested that Riley may have been her only chance at a normal relationship. I'm sure with that thought on her mind Buffy could find some feelings that would suggest it was a bad idea.