Pregnant women tend to need to urinate more than before they were pregnant. This isn't such a bad thing when it comes to medical testing, because your urine is likely to be sampled several times during your pregnancy.
A urine test looks for certain markers in the fluid that can tell a doctor a great deal about the mother's health. Chief among these is the amount of sugar in the blood. If it is too high it could indicate gestational diabetes, a condition that usually starts about halfway through the pregnancy. It is caused when pregnancy hormones stop insulin from removing sugars from the blood and can be corrected through diet and/or medication.
Your doctor will also be looking for protein in the urine, which could indicate a kidney infection; bacteria, which would point to a urinary tract infection; and ketones which occur when the body uses fats instead of carbohydrates for energy and could mean you are dehydrated or undernourished.