You do know that farmers and ranchers have been determining if a cow is pregnant for eons without veterinarians. So some trade group now owns all means to do so in one fell swoop...
So the law is stupid. Big, F**king Deal. To quote from the late Justice Scalia: It is possible for a law to be really stupid but still constitutional.
And if these two were looking at their own herds, then they would as I understand the matter, not have run afoul of the law. But that is not what they did. They started a business of using ultrasound to determine whether other farmer's cows were pregnant and did so without having a veterinary license, and when they were initially called on the carpet for it, they chose to not pursue changing the law - which would have been a rational thing to do - but instead chose to thumb their noses at the law.