It's not because of poor hygiene or your partner is dirty.
Although it would be convenient to blame your partner, the reality is UTIs (urinary tract infections or bladder infections) are very common in women, and especially so with sexual activity because of our anatomy.
The main issue is that the female urethra is very short compared to a man's. During sexual activity, bacteria from the vaginal, anal and oral areas are introduced to the opening of the urethra. The bacteria then just have to ascend a small distance up into the bladder to cause a UTI. UTIs are much less common in men because the male urethra is about four times longer than the female urethra. This means that organisms have to travel much farther to cause a UTI in a man than a woman.
There are many women who rarely had UTIs that become more susceptible to them at different times in their life. Sometimes is just takes getting used to a new partner (or maybe it's because a new partner usually equals more sex). Another common reason is hormonal changes. It's not uncommon for a women to never have infections until perimenopause or menopause, while other women become prone to UTIs during a certain time of their cycle or after changing their form of birth control. Family history also plays a role as women with recurrent UTIs often report their mother or sister having recurrent bladder infections as well.
The only guaranteed way to prevent UTIs related to sexual activity is to not have sex, but if this was my only recommendation I wouldn't have any patients. While some women can decrease their risk of infection with showering or urinating right before or after sexual activity, this doesn't work for everyone. Some women benefit from taking a cranberry or other supplement around the time of sexual activity, but other women can only prevent infections by taking a single dose of an antibiotic at the time of sexual activity. In my experience, most women don't want to take an antibiotic to prevent UTIs because it seems like an excessive amount of medication; however, if a woman has an infection every month, she ends up taking a lot less antibiotic preventatively than if each UTI had to be treated with a full course of antibiotics. The benefit of oral probiotics is controversial, but perhaps the best probiotic is avoiding repeated courses of antibiotics to allow a woman's own vaginal microbiome to replenish. And for those women who start getting infections during menopause, they may benefit from hormone replacement.
Whatever the reason a woman is prone to UTI with sexual activity, it can almost always be treated and shouldn't be a barrier to her sexual wellness.