First of all, the translation of the Bhagavad Gita verse 4.8 is incorrect. Dharma-samsthāpana is mistranslated as "establishing principles of religion". Dharma is not religion.
Brhadaranyaka Upanishad 1.4.14:
यो वै स धर्मः सत्यं वै तत् तस्मात्सत्यं वदन्तमाहुर्धर्मं वदतीति धर्मं वा वदन्तं सत्यं वदतीत्येतद्ध्येवैतदुभयं भवति ।
What is Dharma is indeed Satyam (Reality). Hence they say when someone speaks Satyam, he is indeed speaking Dharma, and when someone speaks Dharma, he is indeed speaking Satyam. The one and same thing becomes both.
Satyam is commonly translated as "truth". However, it is derived from Sat, "that which is", the Real. Hence Satyam means Reality.
Since Brahman is Satyam, as said in Taittiriya Upanishad 2.1:
सत्यं ज्ञानमनन्तं ब्रह्म
Brahman is Satyam (Reality), Jñānam (Knowledge) and Anantam (Infinite)
Hence, Brahman is also Dharma.
Adharma is based in lies, deceit, falsehood. It is Unreal. Brahman is Real.
But because Brahman is the innermost foundation of all that exists, it is the Dharma within Adharma. In other words, we are able to recognize Adharma because of the Dharma within it, i.e. we recognize the Reality of the lies, deceit and falsehood.
This is why Krishna says in Gita 10.36:
Among the deceitful, I am gambling
It's because of the underlying Dharma and Satyam that we can recognize deceit as deceit, because Satyam shows the real nature of things.
Also, Brahman takes human form to uphold Dharma to serve as a role model. Again Krishna says in Gita 3.21:
यद्यदाचरति श्रेष्ठस्तत्तदेवेतरो जनः । स यत्प्रमाणं कुरुते लोकस्तदनुवर्तते ॥
Whatever a role model does, the same is done by the rest. Whatever is upheld as a standard by the role model, the world follows that standard.
न मे पार्थास्ति कर्तव्यं त्रिषु लोकेषु किंचन । नानवाप्तमवाप्तव्यं वर्त एव च कर्मणि ॥
उत्सीदेयुरिमे लोका ... संकरस्य च कर्ता स्यामुपहन्यामिमाः प्रजाः
I don't have any pending commitments in the three worlds, nothing that I want to gain that I already don't have, but I still act (in Dharma). These people would perish... I would cause confusion and destruction of these people.
Finally, another angle from which to look at this... why does Brahman care at all about the world, maintaining order and Dharma in the world?
The answer is that the world is a playful creation of Brahman. As Brahmasutra 2.1.33 says:
The reason for the world is solely play or recreation.
Just as anybody who creates or builds something even just for entertainment (like art, painting, sculpture, house, software app, etc.) takes great pains to protect and maintain it, similarly Brahman also ensures that his universe is maintained properly.