(At least read the main Question portion, the explanation before it and the note below it are very long)
One has to understand a scripture gets its sanctity when it is attributed to wholly to Brahman. If not, it’s just a piece of writing.
There’s a misconception that the Vedic perception of god was deities like Indra, Agni, Surya, etc instead of the Brahman. However there are many scriptures (as well as this answer) which explain that all scriptures are directed wholly and solely towards Brahman, especially the Vedas. For example:
In the Vedas, in the Ramayana, and in the sacred Bharata, O chief of Bharata’s race, Hari is sung in the beginning, the middle, and at the end.
-Mbh Swargarohana Parva Chapter 6
Here I’m concerned with the Vedas. One may contend that this refers to only the Upanishadic portion, but this view is countered by first verse of the last chapter of the 12th skandha of the Srimad Bhagavatam:
Unto that supreme personality whom Brahmā, Varuṇa, Indra, Rudra and the Maruts praise by chanting transcendental hymns and reciting the Vedas with all their corollaries, pada-kramas and Upaniṣads, to whom the chanters of the Sāma Veda always sing,...
Thus, the Vedas in their entirety (including Sama hymns recited from the Samhita portion) are all meant wholly for Brahman.
Further, in the case of Yajnas (barring few like the rain yajna), despite the mantras being addressed to them, it seems that the residents of swarga (Devatas) are not the bestower of fruits of the Yajnas. As discussed in an answer, Indra wrecks Janamejaya’s sacrifice being afraid of fruits accruing to him. The same is the case with Sagara’s Ashvamedha Yajna.
This shows us that the one who bestows the fruits of the Yajna is not Indra, but a higher authority, Brahman, which is also evident from the story of Varadaraja Perumal and Shri Krishna’s statement in the Bhagavad Gita.
- In the case of Varadaraja, the Ashvamedha Yajna was performed by Brahmaji to please Narayana, who appeared as Varadaraja in Kanchi.
- In the Bhagavad Gita Shri Krishna says:
O son of Kunti, even those devotees who faithfully worship other gods also worship Me. But they do so by the wrong method. I am the enjoyer and the only Lord of all sacrifices. But those who fail to realize My divine nature must be reborn.
How do the Vedas, (including the Samhita portion), especially the Sama hymns sing wholly for Brahman?
The Samhita mantras have the devata, rishi and chhanda attributed to them. When the mantras have a fixed path (Viniyoga) toward a specific devata, eg. Indra, who’s addressed repeatedly, how can the mantra be singing Brahman?
Even if there are two meanings to a mantra, where the Viniyoga is directed towards the devata, the mantra would fructify with the meaning directed towards that devata, and not the other meaning directed to Brahman.
(Please note: if it is secret and can’t be explained, it would suffice to mention so, with proper references and a non-secretive hint)
(Please read note before answering)
Note: One would have to use sarvam khalvidam Brahma logic or Ekam sat bahudha logic. Both are incorrect. If we use the logic of Ekam Sat called Yama Matarishvan one has to understand that Yama is the devata ruling over Pitrloka. One can say as per the verse that Brahman manifests as Yama but the fact is the whole world and not only these devatas, is a manifestation of Brahman only. Meaning even asuras and humans are his manifestations. By that logic I can say Ekam Sat he’s called as Mahabali, Hiranyakashipu, etc. Similarly if we say that devatas are a form of Brahman, for example the Ashtamurti forms like Agni etc, it is still that the mantras (as per the Viniyoga) are directed to that devata (resident of swarga) with specific attributes and not Brahman. For both the above logics of ekam sat and Ashtamurti, this answer makes it abundantly clear that the deity is the devata of the mantra (eg. Aditya) and hence the mantra cannot be addressed to Brahman despite Vishnu’s (not Aditya’s) wife being Lakshmi. If we use the logic of everything is Brahman, that way worshipping any sentient insentient thing (including asuras and humans, not only residents of Swarga) also would ultimately on a philosophical level, tantamount to worshipping him only. Hence such a logic is not tenable for answering how the Vedas sing of him. Also answers saying the above is Puranic logic, Vedas are nothing like that, etc won’t be considered.