Are masters programs generally easier to get into than PhD?
Not every STEM Master's program is going to be easier to get into than every PhD program, but on the whole they are easier. Universities are much more likely to take you if you're paying your own way (aka. a Masters) than if they have to fund you. In the US it's  common for students who didn't do so well in undergrad or are from a lesser known international school to pay their way through a Masters first and then go on to a PhD after proving their worth.

That being said, do not discount how helpful research can be. A published paper or a good letter of recommendation from a known professor can go a long way to erasing some bad grades. What counts in a PhD program is your ability to do research.