Penile ulcers can be caused by sexually transmitted infections such as herpes, syphilis, and chancroid. Other causes include skin conditions like psoriasis, eczema, and allergic reactions.