Bismillahi Al-Rahmani Al-Rahim
Strictly speaking: No, scholars cannot charge money for teaching religions subjects. But they can receive money for doing so.
Al-Hajjawi writes in Zad al-mustaqni - with Al-Buhuti's explanations from Al-Raud al-murbi` between (b: ...) as well as some obvious interpolations between brackets - that:
Wages (m: compensation gotten through hiring) are not permissible for something whose performance is restricted to Ahl al-Qurbah (b: meaning: Muslims. [These rulings include things] such as: Hajj, making the call to prayer, and teaching the Qur'an because one of the conditions for these actions is that they be done to draw closer to Allah and thus it is not permissible to take wages for doing it. It is the same if one were to pay wages for someone to pray behind him.
It is permissible to take income for [teaching] these [religious topics] from the Muslim Common Fund [bayt al-mal], take an award [ju`alah], and to take [compensation] if it was not stipulated).
(Al-Raud al-murbi`, p294)
Mar`i bin Yusuf says much the same in Dalil al-talib -with some comments from of Al-Taghlabi's Nail al-ma'arib and and Al-Najdi's Manar al-sabil between (t: ...) and (n: ...) respectively, and again: with some obvious interpolation- when explaining the conditions for taking wages for services rendered
That the work not require that the person performing it be a Muslim. So it is not valid to be hired for making the call to prayer or its commencement; leading the prayer; teaching the Qur'an, fiqh, and hadith; and taking someone's place for Hajj; and passing legal judgments. And [such actions] only take place as worship for the person who performs them (n: because of what the Prophet (Allah bless him and give him peace) said to `Uthman bin Abi al-`Aass, "And get a muadhdhin who does not take wages for the adhan," [Abu Dawud (521), Al-Tirmidhi (209) - and he declared it well authenticated]. And on the authority of Ubay ibn Ka`b who said, "I taught someone the Qur'an and he gifted me with a bow. I mentioned this to the Prophet (Allah bless him and give him peace) and he said, 'If you you took it, you took a bow from the Hellfire.' So I gave it back," [Ibn Majah (2158)]. Ishaq [bin Rahuyah] considered it offensive to teach the Qur'an for wages. `Abd Allah bin Shaqiq, "The bread rolls that teachers take [for teaching] are ill-gotten gains [Ar. Suht]."
Another opinion [from Imam Ahmad] is that it is valid -and Imams Malik and al-Shafi`i permitted it- because the Prophet (Allah bless him and give him peace) said, "The most rightful thing that you could take wages for is the Qur'an," [Al-Bukhari (5737)], and so he permitted taking an award [ju`l] for it, as well as taking wages. (m: But this opinion is not the one used for fatwa.)
If [wages] are given without being stipulated, it is permitted [to take them]. Imam Ahmad said, "One does not ask, and one does not stipulate. And if one is offered something he takes it." He also said, "I dislike a teacher's wages when he stipulates them."
It is permissible to take wages for works that do not require that the person performing them be Muslim, such as teaching calligraphy, mathematics, and building mosques.
It is not permissible to take wages for doing acts of worship which benefit only their performer, such as fasting and prayer; this is without any difference of opinion. This is what he wrote in Al-Sharh).
It is unlawful to take wages for performing them [acts which can only be done by Muslims], but taking an award [ju`alah] is permissible (t: just as it is [permissible] to take compensation that was not stipulated. And it is the same with a ruqyah [protective words].
It is permissible to take wages for teaching calligraphy, mathematics, and licit poetry. If [the student] forgets it during the session he must teach it again; otherwise [if the student forgets it after the session] he does not) (n: to take for doing this, since awards [ju`alah] are broader than wages. This is why awards are permissible even when the work and duration are not known (m: in contrast to hiring something without setting one of those things), and for protective words [ruqya]- Imam Ahmad explicitly stated this because of the hadith from Abu Sa`id concerning reciting protective words for someone stung by a scorpion in exchange for a herd of sheep, which includes: "...And when they came to the Prophet (Allah bless him and give him peace) they told him what happened and he said, 'And how did you realize that it was protective words?' and he then said, 'You hit the mark! Divide [the flock] and set aside my share with yours'" [Al-Bukhari, Muslim, Abu Dawud, Al-Tirmidhi, Ibn Majah].
It is permissible to take income from the Muslim Common Fund [bayt al-mal] or from an endowment [waqf] for deeds which benefit others, such as passing judgments; teaching the Qur'an, hadith, and fiqh; taking someone else's place for Hajj; being a witness; making the call to prayer; and the like, because of public interest. This is not compensation [for those actions], rather it is income to assist in pious actions- and this does not remove it from being an act of worship nor a blemish to sincerity; and if it were, a mujahid would never deserve spoils from jihad nor the equipment of someone he killed).
(Nail al-ma'arib, 1.428; Hashiyat al-lubadi, p216 fn 10,11; Manar al-sabil, pp356-57)
At this point we need to add something very important: Public good requires that fees do get charged for classes. If there were no fees there would be no classes, and if there were no classes people would remain in the criminal state of ignorance that they currently are in. And al-hamdu lillah, there are some contemporary scholars who acknowledge this. (Dr. Nur al-Din `Itr mentions this in the end of his book on `Ulum al-qur'an.)
There is historical precedence for this, namely with the scholars of hadith who lived around the Ka`bah year round. They had no other means of income, so the only way they could support themselves was to charge for narrating hadiths. And if not for this they would have died and we would be deprived of their knowledge.
And Allah knows best.
Wa al-salamu `alaykum,