This phrase should be used carefully to avoid unfairly judging others by the company they keep. Just because he was seen with them once doesn't mean he's getting into bad company.
Pro Tip 2/3
Social Influence
The phrase often suggests that the 'bad company' could lead someone to make poor choices due to peer pressure. Ever since she got into bad company, her grades started slipping.
Pro Tip 3/3
Parental Concern
It is commonly used by parents or guardians expressing worry about their children's social circles. My mom's always lecturing me about keeping bad company.