You could try placing the moon closer to the planet, giving the planet more mass, or placing the planet with the moon further away from the star.
Unless it's a bug, it's because the star's gravitational force upon the moon is bigger than the planet's gravitational force. You can turn on "hill spheres" from the options menu. If you place the moon inside the hill sphere around the planet, the moon should orbit the planet.