To study the effect of main flock target practices and milking machine features on the variation of bulk tank milk (BTM) somatic cell count (SCC) and total bacterial count (TBC) in dairy sheep flocks, a total of 3458 records of BTM SCC and TBC, corresponding to 340 audited flocks from the Consorcio de Promoción del Ovino of Castilla y León region (Spain), were collected throughout 12 months before testing the technical features of their milking machines. Average values were established for flock size (485.6 ewes), replacement rate (21.1%), parlor capacity (35.7 places), number of milking units (13.8), milking vacuum (36.2 kPa), pump air capacity at 50 and 36 kPa (106.4 and 158.3 L/min per milking unit), manual reserve (122.3 L/min per milking unit), air, milk and milking unit system consumptions (8.0 to 12.5 L/min per milking unit), internal diameters of the main air and milk pipes (5.9 mm and 4.2 mm per milking unit), pulsation rate and ratio (161.1 c/min and 57.4%), age and time since the last revision of the milking installation (16.3 years and 48.1 months), BTM temperature (3.4 °C) and washing water temperature at water-heater outlet (62.1 °C). Antibiotic dry therapy, time since last milking machine revision, and warm water temperature were critical factors influencing BTM SCC and TBC variation. Optimised BTM quality was also obtained for flocks with a greater size and foreign breeds, confined and post-dipped, with daily bedding maintenance, a low-level milk pipeline system, the presence of pulsation airline, greater manual reserve, smaller milk system consumption, and greater main air and pulsation pipe diameters. Greater milk pipe diameters and pulsation rates ≥180 c/min were associated with smaller SCC, but greater TBC, whereas pulsation ratios ≥60% increased SCC, but decreased TBC. Overall, results will allow for the optimisation of educational and risk management programs in the dairy sheep sector to improve flock mammary health and BTM hygiene.