Mishnah 5 in chapter 8 of Maseches Sotah continues with the words spoken to the army before it goes out to war. In this case the Gemara clarifies that these words were said by the officers alone, and not by the kohen at all.
The words of the Mishnah:
The Mishnah cites the verse: "Veyasfu hashotrim ledaber el ha'am ve'amru: Mi ha'ish hayarei verach halevav yelech veyashov leveiso" - the officers continued speaking further to the people, to the soldiers, and said that whoever is fearful and fainthearted should go and return to his home.
To what does the expression "hayarei verach halevav" refer?
Rabbi Akiva: since the verse says "hayarei verach halevav," it is to be understood plainly, according to its simple meaning - "she'eino yachol la'amod bekishrei hamilchamah" - he cannot hold his ground in the ranks of battle. The "ranks of battle" means the ability to stand in the line facing the enemy without breaking it, and likewise "velir'os cherev shelufah" - he cannot bear the sight of a drawn sword coming at him.
Rabbi Yosi HaGlili: this is not the intent; rather, "zehu hamisyarei min ha'aveiros shebeyado" - a man who is afraid because of the sins in his hands, and worries that on their account he will be harmed in the war. That is the fear that grips him.
The Gemara clarifies that Rabbi Yosi HaGlili does not disagree with Rabbi Akiva, and in his view fear of physical harm is also included, for the verse says "velo yimas es levav echav kilvavo" - that he is liable to infect others with his fear, and from here it is clear that the words certainly refer as well to fear of the war itself. It is only that Rabbi Yosi HaGlili held that the intent includes the sins in his hands as well, and even if he transgressed the words of the Sages - something whose source is in the words of the Sages, derabbanan.
"Lefichach talsah lahem haTorah es kol elu":
Since the one who returns is afraid because of his sins, the Torah provided all the other reasons for which one is permitted to leave - so that he may return on account of them, so that those around him will not know the real reason and he will not be embarrassed. They will think that he left because he built a new house, or because he married a new wife, and the like.
The view of Rabbi Yosi:
Rabbi Yosi says that the transgressions being spoken of are transgressions of negative commandments, among them:
"Almanah lekohen gadol" - a widow married to a Kohen Gadol.
"Gerushah vachalutzah lekohen hedyot" - a divorcee or a chalutzah married to an ordinary kohen.
"Mamzeres unesinah leYisrael" - a mamzeres or a nesinah married to a Yisrael, who is forbidden to him.
"Bas Yisrael lemamzer" - an ordinary Jewish woman married to a mamzer.
These prohibitions are negative commandments for the man as well as for the woman, and here we are dealing with the man going out to war. By specifying precisely these particular transgressions, Rabbi Yosi means to say that the concern is only for transgressions that are from the Torah, d'oraisa; transgressions that are derabbanan are not a legitimate reason to return from the war.
In summary: in this Mishnah we learned the words of the officers - "whoever is fearful and fainthearted should go and return to his home" - and the dispute over their explanation: according to Rabbi Akiva it is to be taken plainly, one who cannot hold his ground in the ranks of battle and see a drawn sword; and according to Rabbi Yosi HaGlili, one who is afraid because of the sins in his hands, even those of rabbinic origin. We saw that the Torah provided all the other reasons for returning so that the one returning because of his sins would not be embarrassed, and we learned the view of Rabbi Yosi, who lists negative commandments and thereby defines that only Torah transgressions justify returning from the war.