Your quoted text is from M.N. Selasutta, that buddha taught to selabrahmaṇa:
aggihuttamukhā yaññā sāvittī chandaso mukham.
Sacrifices have the agnihotra as foremost; of meter the foremost is the Sāvitrī
So, buddha didn't taught veda. Buddha just use selabrahmaṇa's knowledge, veda, to teach him the last line:
puññaṃ ākaṅkhamānānaṃ, saṅgho ve yajataṃ mukha’’nti
Saṅgha is the best foremost of wholesome-mind developers.
This last line is the real buddha's teaching. Your quoted line, veda, was used by buddha just as a simile, as a tool to make selabrahmmaṇa understand the last line.
Your quote is similar: it references an example of brahmaṇa-people's best thing, to show sela-brahmaṇa how the last line is the best. Only that last line is the buddha's teaching; your quote is just a borrowed example, which buddha borrowed from brahmaṇa's veda, to teach sela-brahmaṇa the last line.
How can you teach a new language to a foreigner? You use their already-known language to teach them new language, right? That is what buddha did.