When you are with responsible friends, you have less peer pressure to engage in risky behaviors.
By having responsible friends, you are more likely to be discouraged from doing irresponsible things. Whether it's regarding alcohol or drugs, responsible friends may influence you not to do those kinds of things.
In regards to behaviors that put you at risk for an STI, responsible friends may influence you to stay away from situations that may encourage risky behavior; therefore, the likeliness for you getting an STI is lower.