Diabetes can damage nerves, restrict blood flow and affect testosterone levels, increasing erectile dysfunction risk.