Praise be to Allah.
This is the issue of praying behind a rebellious sinner (faasiq). The faasiq is one who disobeys Allaah by committing one of the major sins (kabeerah) or persisting in committing a minor sin (sagheerah). According to what was said in your question, you are committing some major sins, namely working in a bank and shaving your beard. These are two major sins according to the standards of sharee’ah.
With regard to working in the bank:
It was narrated that Jaabir said: The Messenger of Allaah (peace and blessings of Allaah be upon him) cursed the one who consumes riba (usury, interest), the one who pays it, the one who writes it down and the two who witness it. He said: they are all the same.” (Narrated by Muslim, no. 1598).
It was narrated that Samurah ibn Jundub said: The Prophet (peace and blessings of Allaah be upon him) said: “Last night I saw (in a dream) two men who came to me and took me out to a holy land. We set out until we came to a river of blood in which a man was standing, and on the riverbank there was another man in front of whom were some stones. The man in the river came towards him, and when he wanted to get out, the other man threw a stone into his mouth and sent him back to where he started. Every time he tried to get out, the other man threw a stone into his mouth and sent him back. I said, ‘What is this?’ They said, ‘The one whom you saw in the river was one who consumed riba.’” (Narrated by al-Bukhaari, 2085).
With regard to shaving the beard:
It was narrated that Ibn ‘Umar (may Allaah be pleased with him) said: The Messenger of Allaah (peace and blessings of Allaah be upon him) said: “Be different from the mushrikeen, trim the moustache and let the beard grow.” (Narrated by al-Bukhaari, 5892, Muslim, 601).
Shaykh Ibn Baaz (may Allaah have mercy on him) said:
The beard (al-lahyah) is that which grows on the cheeks and chin, as was explained by the author of al-Qaamoos. It is obligatory to leave the hair that grows on the cheeks and chin, and not to shave it or cut it.
May Allaah reform the affairs of all the Muslims.
Fataawa Islamiyyah, 2/325.
Shaykh Ibn ‘Uthaymeen said:
The definition of the beard (al-lahyah) as stated by the scholars of the (Arabic) language is the hair of the face, jawbone and cheeks, in the sense that everything that grows on the cheeks, jawbone and chin is part of the beard. Removing any part of it also comes under the heading of sin, because the Messenger (peace and blessings of Allaah be upon him) said: “Leave the beard alone” and “Let the beard grow.” This indicates that it is not permissible to remove any part of it, but the sin varies in degree; shaving is more serious than removing a part of it because it is a more extreme action and the one who shaves it more clearly goes against the command than the one who trims it.
Fataawa Hammah, p. 36
See also Question no. 8196.
With regard to praying behind one whose sin is obvious, the scholars differed concerning this issue, and there are two opinions.
The first view is that it is not correct to pray behind a faasiq (rebellious sinner).
This is the view of Ahmad and Maalik, in one of the two reports narrated from them.
Shaykh Mustafa al-Ruhaybaani said: (Section) (It is not correct to pray behind a faasiq at all): i.e., whether his fisq (sin, rebellion) has to do with his beliefs or his doing a haraam action, even if it is concealed, because Allaah says (interpretation of the meaning):
“Is then he who is a believer like him who is a Faasiq (disbeliever and disobedient to Allaah)? [al-Sajdah 32:18]
Mataalib Ooli al-Nuha, 1/653
Shaykh al-Islam [Ibn Taymiyah] (may Allaah have mercy on him) said:
The imaams are agreed that it is disliked (makrooh) to pray behind a Faasiq, but they differed as to whether the prayer is valid. Some said that it is not valid, such as Maalik and Ahmad according to one of the two reports narrated from them. Some said that it is valid, such as Abu Haneefah, al-Shaafa’i, and the other report from [Malik and Ahmad]. But they did not dispute concerning the fact that such a one should not be appointed [to lead the prayer].
Majmoo’ al-Fataawa, 23/358
The second opinion, that prayer behind a faasiq is valid, even if his sin is obvious, is the correct view and it is the view favoured by Shaykh Muhammad ibn ‘Uthaymeen (may Allaah have mercy on him). The evidence for this view is as follows:
1 – The general meaning of the hadeeth of the Prophet (peace and blessings of Allaah be upon him): “The people should be led in prayer by the one among them who has most knowlegde of the Book of Allaah.” (Narrated by Muslim, 673).
2 – The specific meaning of the words of the Prophet (peace and blessings of Allaah be upon him) concerning oppressive leaders who lead the prayer at the wrong time: “Pray the prayer on time, then if you come to them at the time when they are praying, pray with them, and it will be a naafil prayer for you.” (Narrated by Muslim, 648). And al-Bukhaari narrated: “If the imaam leads the prayer correctly, then he and you will receive the rewards, but if he makes a mistake (in the prayer) then you will receive the reward for the prayer and the sin (will be his).” (Narrated by al-Bukhaari, 694).
3 – The Sahaabah, including Ibn ‘Umar, used to pray behind al-Hajjaaj, and Ibn ‘Umar was one of the keenest of people to follow the Sunnah and pay attention to it, and al-Hajjaaj was known to be one of the most rebellious and sinful of the slaves of Allaah.
It might also be said that everyone whose prayer is valid, it is also valid for him to lead the prayer. There is no evidence to suggest that we should differentiate between the validity of the prayer and the validity of leading the prayer, because if a person commits a sin, he does so for himself, but this is merely theoretical. See al-Sharh al-Mumti’ by Ibn ‘Uthaymeen, 4/304).
You should note that the reward for leading the prayers is very great and it is a great honour. The Prophet (peace and blessings of Allaah be upon him) said that the one who has more knowledge of Qur’aan (i.e., the one who has memorized more) is the one who should be given precedence in leading the prayer. (See Question no. 1875) Therefore if someone else knows more Qur’aan than you do, he should be given precedence. If there is no one other than yourself, then it is o.k. for you to lead the others in prayer, even if you are a sinner for the reasons explained above.
Finally, we advise you to fear Allaah and to avoid waging war against Him by sinning. Hasten to repent to Allaah before death comes to you and you regret it at the time when regret will not avail you anything.