Welcome to HCM.
Your urine test does not seem to warrant any treatment, but your obstetrician knows best. If she considers it necessary then you have to take those medicines.
Since it is prescribed by an obstetrician, she would be careful to prescribe only those medicines which are safe in pregnancy
There could be a variety of causes for urinary tract infection
. Drink plenty of water.