Azoospermia or absence of sperm in semen can be caused by genetic issues like congenital absence of the vas deferens. It can also be the result of infections including sexually transmitted infections and certain medical treatments like cancer treatments.