The primary causes of epididymitis are bacterial infections, which can be transmitted sexually or non-sexually. Common pathogens include Chlamydia trachomatis and Neisseria gonorrhoeae, both of which are sexually transmitted. Non-sexually transmitted bacteria like Escherichia coli can also cause the condition, particularly in older men.