The author postulates that Ted hates David because David got married while Ted remained alone.
David is married and Ted is single.
The author said Ted and David are good friends because Ted supports davids young marriage.