If any cohorts gave way in battle, he (Augustus) decimated them, and fed the rest on barley.
(Suetonius, Life of Augustus, 24.2)
More confirmation for the practice, not necessarily always in connection with decimatio:
Polybios: 6.37, Frontinus: Stratagems, 4.25/37, Plutarch: Antony 39, Plutarch: Marcellus 25.6, as well as Livius
27.13.9; Cassius Dio 49.27.1, 38.4., Vegetius Mil. 1.13:
The Drill Called Armatura
The new levies also should be taught […]. [The old Romans] rewarded the masters at arms with a double allowance of provision. The soldiers who were backward in this drill were punished by having their allowance in barley.
This (collective) punishment was called frumentum mutatum. As collective punishments go, this one was milder than being sent extra muros (bivouac outside of the fortified camp) or misso ignominosa (dishonourable discharge).
Frumentum mutatum Frumentum is the daily food ration. A unit in disgrace loses all meat from its diet, and is switched from wheat to barley rations. As barley is usually used as animal fodder, this represents a substantial loss of status. Occasionally the commanding officer adds insult to injury by docking the pay of those in the unit at the same time.
— Philip Matyszak: "Legionary the Roman soldier's (unofficial) manual", Thames & Hudson, London, 2013.
This 'change of rations' as punishment was meted out in addition to individuals who may have demonstrated some ineptitude or other forms of disciplinary lapse, not only collectives (cf Vegetius above).
A Roman writer describing barley itself:
Barley bread was much used in earlier days, but has been condemned by experience, and barley is now mostly fed to animals, although the consumption of barley-water is proved so conclusively to be very conducive to strength and health: Hippocrates…
— Pliny the Elder, Natural History
Wheat was just seen as being of much higher status than barley. Sometimes even wheat was regarded as being much healthier than barley, although that was often the opinion of for example bakers and nobles, while many medical authorities often kept barley in quite high esteem. Within the legions barley was held in high esteem in a specialized way: for making alcoholic malted drinks. For daily bread and porridge instead they much preferred wheat.
With pure wheat one can make a very fine and tasty bread, with pure barley not really. Mixing barley into wheat was common and made an acceptable bread, if not a very good one, nutritionally. Barley gruel or soup was always acceptable and much cheaper than any bread anyway, but being fed on pure barley would mean to either get a 'difficult' bread or being forced to slurp it up.
During the last centuries bc in Rome barley gradually became less esteemed. This must have been partly due to improvements in bread-making. Barley contains much less gluten than wheat, this being the substance which gives wheat bread its form, elastic texture and ability to rise. Leavened bread can be made from barley, but it is always dense, coarse in texture, and dark, although the flavour may be mild and pleasant. Also, barley breads stale quickly, because they lack the water-retaining powers of the gluten network in wheat or the natural gums in rye. Thus increasing skill in making well-risen bread, and the universal preference for light-coloured bread, led to a demand for wheat from those who could afford it. […]
… Aristotle thought barley less health giving than wheat, and it is evident that richer, more cosmopolitan communities such as Athens, where there existed a body of professional bakers able to manipulate leavenings, favoured wheaten bread as lighter and more digestible. The same was true of classical Rome; panis hordeacius was by and large for slaves and the poor.
— Alan Davidson & Tom Jaine (eds): "The Oxford Companion to Food", Oxford University Press: Oxford, 32014. (Wikipedia, reference)
Barley was eaten in much larger amounts in the ancient diet many parts of the empire than traditionally assumed. It was certainly not only punishment. We see that from the amounts of barley produced and eaten around the towns and camps, for civilian life and military alike, as we see in this report from Caesar at Dyrrachium:
The men did not object when they were issued with barley or vegetables. Indeed meat, of which there was a plentiful supply from Epirus, they held in great esteem. The men who had been with Valerius discovered a type of root called chara which, when mixed with milk, greatly eased the shortage of supplies. There was plenty of this and they made a sort of bread out of it.
(BC iii, 47-8.)
And a 'siege diet' for a besieging Roman army that ran almost as fast out of supplies than the besieged:
The soldiers were worn out by the continuous watch, lack of sleep, and the unaccustomed food of the country. They had no [vintage] wine, salt, sour wine or oil, but fed on wheat and barley, and large quantities of meat and hare boiled without salt, which upset their digestion.
(Appian Iberica 54)
– R. W. Davies: "The Roman Military Diet", Britannia, Vol. 2 (1971), p122–142. (both quotes above, doi)
The modern meaning of a 'com-pany' is based on the meaning 'those eating bread together'.
Pure barley was in later Roman times quite disliked. And separating those to be punished by giving them special food and comparatively low-status food at that was the goal. Public humiliation as an example for the others.
(— Naum Jasny: "The Daily Bread of the Ancient Greeks and Romans", Osiris, Vol. 9, 1950, (p227–253; doi). — Pat Southern: "The Roman Army. A Social and Institutional History", ABC-Clio: Santa Barbara, Denver, 2006)
It really should be noted that this decimatio form of punishment fell periodically into disuse during the republic, being seen as the means of an inefficient commander and that it was not that common in later times:
The decimatio is documented for the Republican period; it was also practised in the period of the Principate, albeit rarely, and was perceived as a relic of an epoch long ago (Suet. Calig. 48,1. Galba 12,2. Tac. Ann. 3,21,1; Hist. 1,37,3; 1,51,5).
— Le Bohec, Yann (Lyon), “Decimatio”, in: Brill’s New Pauly, Antiquity volumes edited by: Hubert Cancik and , Helmuth Schneider, English Edition by: Christine F. Salazar, Classical Tradition volumes edited by: Manfred Landfester, English Edition by: Francis G. Gentry. doi 2006
More on the process of decimatio in
— Elizabeth Pearson: "Decimation and Unit Cohesion: Why Were Roman Legionaries Willing to Perform Decimation?", Journal of Military History, Vol. 83 Issue 3, Jul 2019, p665-688.
— Kate Britton & Jacqui Huntley “New Evidence for the Consumption of Barley at Romano-British Military and Civilian Sites, from the Analysis of Cereal Bran Fragments in Faecal Material”, Vegetation History and Archaeobotany 20, p41–52, 2011. (PDF)
— Charles Goldberg: "Decimation in the Roman Republic", The Classical Journal, Vol. 111, No. 2 (December 2015-January 2016), p141–164.