Shaykh al-Islām said:
A Comprehensive Section
I have written previously in several places—before some of the principles and at the end of the draft on jurisprudence—that justice encompasses all good deeds, and wrongdoing encompasses all evil deeds. This is a great, comprehensive principle.
To explain this in detail: Allah brought creation into being to worship Him. This is the intended purpose of all good deeds: to devote all religion sincerely to Allah. Any deed that fails to fulfil this purpose is not an unqualified good deed deserving Allah’s reward in the Hereafter, even though it may be good in some respects and earn a reward in this world. Everything He has forbidden is a departure and deviation from uprightness, placing something where it does not belong; it is therefore wrongdoing.
For this reason, He—glorified be He—joined the two together in His words:
“Say, ‘My Lord has commanded justice. Direct your faces toward Him at every place of worship, and call upon Him, devoting your religion sincerely to Him.’”
This verse is in Surah al-A‘rāf, which addresses the foundations of religion and holding fast to the Book. It condemns those who instituted religious practices that Allah did not authorize, such as associating partners with Him and forbidding wholesome things, or who opposed what Allah had prescribed in matters of their religion. These include Iblīs, those who opposed the messengers—from the people of Noah to the people of Pharaoh—and those among the People of the Book who altered the Book.
Thus, the surah condemns those who introduced a false religion, such as the disbelieving Arabs, and those who opposed the true religion, whether entirely, like those who disbelieved in the prophets, or partially, like the disbelievers among the People of the Book. In this surah, in al-An‘ām, and elsewhere, He—glorified be He—has grouped the sins of those who associate partners with Him into two categories.