Why is Macbeth crowned king?

Through a series of events.

He plotted the murder of King Duncan, and pretended that his drunken guards had done it, then killed the guards to show how 'angry' he was.

However, Duncan's sons (Malcolm and ... The other one) saw that this was a plotted murder and fled the country.

Since the two heirs to the thrones were gone, Macbeth was crowned king, since he had fought well at the battle in the start if the play, the King loved him, he had avenged the king, and was seen fit to have the throne.