Why is the earth tilted on an angle, and why is there a moon that circulated earth each and every day

Why is the earth tilted on an angle, and why is there a moon that circulated earth each and every day?