This is known as differential association.
It is a theory proposed by Edwin Sutherland, an American sociologist. He believed that if we are surrounded by crime, and people who partake in criminal actions, we will develop deviant behavior ourselves, which he termed 'differential association.' He stressed our interaction with the society around us and its influence on our lives and behavior.