According to the Qur’an, a true Muslim should refer to scholars to get himself well-acquainted with the sound image of Islam.
There is nothing wrong in praying behind a salaried imam as long as he is qualified to lead the congregational prayer. Also, you have to bear in mind the fact that Islam cares about the interest and welfare of the Muslim community. Therefore, if the Muslim community needs an Imam to lead them in prayer and to teach them Islamic knowledge, they can give him a salary in return for his time and effort.
In this regard, Dr. Muzammil H. Siddiqi, former President of the Islamic Society of North America, states:
“Many jurists have allowed Imams to receive a salary. A Muslim can pray at any place; he does not have to be present at a particular mosque, but the Imam of the mosque is required to be at a particular mosque on time in order to lead the prayers.
This is called “ilzam ma la yalzam” (requiring what is not required). So an Imam is not paid for leading the prayer, but for his special time and effort to be at a particular masjid at all times.” Given the above, it is valid to pray behind an imam who receives a salary as long as the imam himself is qualified to lead the prayer.