Speaking as someone who plays CK2 religiously, Chaste is different to Celibate, which is different to Eunuch.
Chaste is a virtue and so can be given through education (this is why you always educate your heir yourself, otherwise you end up with a shy gluttonous Indulgent Wastrel) or through events.
To the best of my knowledge there are three ways to gain Celibate:
1) joining a holy order (this requires abdicating so you can't do it to player characters)
2) joining the Dominican Order and reaching the second level of membership, then using the ”Take a Vow of Celibacy” decision in the intrigue menu (only works for Catholics)
3) in the ”The Wounds Within” event you can get after a battle where you lead troops, taking the ”I will never be close to anyone ever again” option.
The only way to gain Eunuch on characters you want to play is by taking the risky option when you ask your court physician for treatment. I have no idea why my doctor thinks cutting off my bollocks will cure my flu, but it's a quick and easy way to deal with gavelkind.
Chaste and celibate characters can marry, eunuchs can't. However, becoming a eunuch doesn't end your marriage or, weirdly enough, change your wife's opinion of you.