Generally people tend to make preference of one action upon the other according their own rationality. If some individuals do use Shar‘ī’a as their benchmark to establish preference then too they seldom look into the matter with care. Is the shar‘ī evidence sufficient or not? Is it even compatible in the scenario or not? Hence, when most people make such preference, they simply think what is more virtuous according to how they think. For this, they establish a benchmark in their minds. After all there has to be some criterion to establish preference. If one silver coin is to be given preference over the other, there must be a reason. Similarly if one cloth is better than other, then the preference must be based on some form of criterion.
General people have thus established this criterion in their minds. The criteria is that when any act “seems” to be “dressed up” as visually more worshiping, it is preferred.
The reality of the matter is that actions are of two types.
a. An act whose reality is an act of worship, as well as they have an appearance of worship as well. E.g. Salāh. Performing salāh is an act of worship, both visually as well as intrinsically. Another such example is building a mosque such that it has a visual form to it.
b. An act whose reality is an act of worship, but their visual appearance does not have any form of worship. Neither does such an act resemble an act of worship such that it becomes shown to everyone. E.g. helping a student; financially or in kind.
This is an act of worship because it is a service of dīn, and this service to dīn can be understood once the student graduates and starts working in religious field.
Both are acts of worship, yet they are different. Building of a mosque is visually an act of worship which is obvious. The worship in it not even hidden. We all understand that Salāh is an ‘ibādah, hence building a masjid is a direct link towards ‘ibādah. This is why people link spending in establishment of masjid as a lofty ‘ibādah.
Contrary to this, consider the act of feeding a student. This act of worship is linked to something which is not obvious (before our sight). So people also do not easily grasp it as an ‘ibādah. Secondly, feeding has a link to the actual essence of ‘ibādah via deeper link within, because assisting a student of dīn is a farther link towards assisting dīn, which does not get so obvious. This is because when one sees a student learning initial stages of Arabic, or philosophy, then one does not feel this as an ‘ibādah. As far as he is concerned this assistance of the student will only become an ‘ibādah with virtue of wealth and its end outcome. That is to say, if this student continues in his studies for ten years and then graduates, then and only then he will become able to serve dīn and serving dīn is most virtuous of deeds.
[Hence the failure to recognize that both these form of ‘ibadāt are valid and important, leads a layman to incorrectly ascribe afdhaliyah of one over the other.]
Jawāhirāt al-Hakīm al-Ummat , Pg 301.