Herod was literally King of the Jews. He wasn't about to give up that title to anyone, it was being preserved for his heir. His insecurity would not allow him to let this happen. His decision to murder all under 2 in Bethlehem was in keeping with his character and ambition.