It sounds like echinococcus to me. It is a tapeworm of canids (which are the definitive hosts) and it is transmitted to the intermediate host (sheep, cattle and other erbivores) by eating food contaminated with their eggs. It is also a zoonosis, so people could get infected with eggs.
The result, as you've been told, is cysts in the meat (and other organs, it tends to go to liver, lungs, brain etc) which condemn the carcass. If the meat with cysts is eaten by a canid, the parasite cycle can start again.
Other sheep won't have caught it from your ram as it needs the passage through dog/fox feces to transmit, and also if you are sure that they won't have had contact with dogs whilst with you, this sort of cysts can take months, even years to develop. I would say the ram picked the infection up before you got him.