If Your Parents Order you to Keep Bad Company, don't Obey them
Question :
I keep company with good religious friends, but my parents don't approve. They censure me often and sometimes they even hit me. Is it allowed for me to obey my parents in this situation?
Answer:
Keeping company with good people is one of the best means of drawing nearer to Allâh and one of the greatest means to achieve happiness.
As for keeping company with evil people among the disbelievers or those who sin openly, this is not permissible, and it is one of the causes that lead to an evil end, and it leads to falling victim to the same behavior and practices as theirs.
It is correct that the Prophet made a parable between the righteous companion and the musk dealer from whom you will either get some perfume, he will sell it to you; and if none of these, you will at least smell a good smell.
He then made the parable of an evil companion and the blacksmith, and he said that either your clothes will burn or you will find a rotten smell emitting from him.
Therefore, it is obligatory for the believer to struggle to be in the company of the righteous and to stay away from the company of the evil, and it is not allowed to obey the parents, or any one else in accompanying evil people nor in avoiding the company of righteous people due to the saying of the Prophet ﷺ :
"Indeed, obedience is only in what is good."
He ﷺ also said:
"There is no obedience to a creature in disobedience to the Creator."
And with Allah is the facilitation to do what is right.
Source:
Ibn Baz
Fatawa Islamiyah, Vol. 7 Pages 328-329