First of all, it is be noted that Islam demands its adherents to follow the Prophet’s guidance in each sphere of life. In their social, political, religious, and daily gatherings, Muslims should abide by a certain code of ethics that is based on the Qur’an and the Sunnah of the Prophet (peace and blessings be upon him). According to the Sunnah, if three rows of Muslims offer funeral prayer for a dead Muslim, it will be good for the dead. Therefore, if we can make people stand in three rows for the funeral prayer, this will be good; if it is so difficult, then we are not required to make odd number of rows.
Responding to your question, the prominent Muslim scholar Sheikh Sa`d Ash-Shuwayrikh states:
“It is related in the Sunnah to make three rows for the funeral prayer. The Prophet (peace and blessings be upon him) said: “Whoever dies and three rows of Muslims pray for him, then he will be entitled to good” (Abu Dawud and At-Tirmidhi).
For this reason, Imam Malik used to divide people into three rows for the funeral prayer.
However, if having three rows is not practical, then we need not endeavor for some other odd number. We prefer three rows because it was explicitly stated in the Sunnah, but the Sunnah never mentions odd numbers in general.”