A cow or ewe must have a calf or lamb every year to produce milk. Half of those offspring will be male, and thus will not produce milk. Ergo they were eaten, because you only need one bull or ram for a much larger number of breeding females.
The limiting factor for livestock keeping in the medieval period was winter fodder--there was enough summer grazing for the spring births in fallow fields that they fertilized with their manure , but not enough hay and grazing to get them through the winter. So the lambs--all the males and some of the females--would be butchered in the fall. A bull calf might be butchered as veal (or "baby beef", depending on timing) its first fall or might be over-wintered and butchered as beef the following fall. A few of the older ewes would be butchered as mutton, replaced with female lambs from the spring births. A female calf would be traded, sold, or kept as a replacement.
Similarly, half of the chicks born would be male, destined for spring/early summer butchering. (Or caponed, castrated, though that's much more difficult with a bird.) Chicken is a lean meat, though, and rather tough in a free-range bird, so it was usually stewed rather than roasted. Capon was a bit of a luxury food due to the difficulty of castrating them. Geese were much more popular due to the fattier meat.
Pork was plentiful due in part to the large size of a sow's litter. Over-winter one sow, and you get eight piglets or so, much more than a cow's single calf or a ewe's one to four lambs. Even if you didn't keep your own sow, buying piglets to raise and fatten was common. Most medieval pigs would forage rather than being fed scraps--hence the ubiquity of swineherd as a humble occupation.