I have a lot of veterinarian friends, and the fact of the matter is farmers purchase antibiotics like any other supplies. Farmers get to skirt the process most other animal owners go through, and in most states and jurisdictions don't need to go through a licensed veterinarian to obtain antibiotics.
Most veterinarians I know think it's ridiculous, and causes more harm than good. But farmers have lobbied for these freedoms. Many veterinarian friends complain that many farmers are entitled, and feel that they should be able to do whatever they want with their herd.
If you ask me, Farming is one profession that needs to have stronger regulations that are actually enforced e.g. antibiotics, humane treatment, etc.
It's a grey area for sure -- do I let my sick animals suffer so I can sell them? Or do I give them medicine that makes them ineligible for certain consumption categories.