Sergeant Troy is your typical cocky young man who thinks that the best way to make women like him is to lie to them. But, uh, it works for him. The ladies love Troy. Take, for instance, his engagement to Fanny Robin. When Fanny shows up at his army barracks and asks him to marry her as soon as possible, Troy can only stumble over his words in saying, "The fact is I forgot to ask [permission to leave]. Your coming like this is so sudden and unexpected" (11.61). Or in other words, he keeps putting off their marriage for as long as possible… like the nice guy he is.
But despite Troy's reputation as a womanizer, people's opinions are still divided about him. After all, he comes from a good family and has a high level of education. The servant Liddy best shows this divided opinion when she says to Bathsheba, "O miss—I blush to name it—[he is] a gay man—a walking ruin to honest girls, so some people say. But I know him to be very quick and trim, who might have made his thousands as a squire" (24.65). Or in other words, people in Hardy's time (like today) aren't too hard on a guy for being a player, so long as they're charming and fun to be around. And that's exactly what Sergeant Troy is.
You might not like Troy, but the guy isn't entirely evil. He just has his own style of living life that tends to hurt people. Or as the narrator says, "He was a man to whom memories were an encumbrance and anticipations a superfluity. Simply feeling, considering and caring for what was before his eyes he was vulnerable only in the present" (25.2). He's a dude who totally lives in the here and now. But even that all changes when Fanny Robin dies, along with the child that she and Troy had together. The horror of this event finally seems to reach Troy's heart, and the guy realizes that he'll never love anyone as much as he loved Fanny.
With all that said, Troy quickly goes back to being the guy he always was shortly after Fanny Robin is buried. The book suggests that there's a good heart somewhere inside the guy; but he's just too lazy to change his ways.