The male and female urinary tract is different when it comes to anatomy.
Females have shorter urethras than their male counterparts. A shorter urethra makes it easier for bacteria
up the urethra to the bladder
. The urethra in a female is also closer to the rectum allowing for a shorter distance for bacteria to travel. This is why proper hygiene is recommended for females to prevent uti.
Answer assisted by Mazin Albert, Medical Student