we should not neglect any type of infection,
as UTI and/or diarrhea
can lead to premature uterine contractions and can also affect the general health, better to use antibiotics as suggested by your doctor because benefits over weigh the risks here,
usually your doctor might have recommended you the antibiotics which are considered as relatively safe in pregnancy.
for more details on UIT you can read my article,