Macbeth would have believed in Comitatus, the King / Thane bond of loyalty. It states that a King, ordained by God, will give a Thane land and protection in return for allegiance to the death. Therefore, a Thane must defend his King at all costs, after which he may be handsomely rewarded, as is Macbeth.
We see Comitatus expressed, ironically, after Duncan has been murdered by the loyal Thane, Banquo. He says, and the others pledge:
In the great hand of God I stand; and thence
Against the undivulged pretence I fight
Of treasonous malice.
In the name of God, they take a holy vow to avenge Duncan's death and restore order to his Kingdom. Later, Macduff, acting on this bond, will avenge Duncan's death and restore Malcolm to the throne.
Macbeth might also have believed in the "Divine Right of Kings," which was certainly a belief held by James I, to whom Shakespeare dedicated this play. The Divine Right of Kings holds that the King is God's holy vessel and shall answer to no man, only God. As the Enotes reference says:
The Divine Right of Kings is a political and religious doctrine of royal absolutism. It asserts that a monarch is subject to no earthly authority, deriving his right to rule directly from the will of God. The king is thus not subject to the will of his people, the aristocracy, or any other estate of the realm, including the church. The doctrine implies that any attempt to depose the king or to restrict his powers runs contrary to the will of God and may constitute heresy.
The remoter origins of the theory are rooted in the medieval idea that God had bestowed earthly power to the king, just as God had given spiritual power and authority to the church, centering on the pope. The immediate author of the theory was Jean Bodin, who based it on the interpretation of Roman law. With the rise of nation-states and the Protestant Reformation, the theory of divine right justified the king's absolute authority in both political and spiritual matters. The theory came to the fore in England under the reign of King James I of England (1603–25, having been King James VI of Scotland from 1567).
In brief, I'll add some lines to the above answer.
King James i (1567-1625) (James vi of Scotland) in the Jacobean era, had a fear that the Catholics would rise voice against him. So, in his speech to parliament in 1609, he said, "The state of monarchy is the supremest thing upon earth ... Kings are justly called Gods, for that they exercise a manner or resemblance of divine power upon earth" and thus, imposed the rule that his subjects should obey him as a divine creature and must not go against him.
In the Jacobean play, Macbeth, Shakespeare also applies this issue of the divine rights of kings. Macbeth, as a representative of the Scots of that age, holds on this common notion that kings are the possessor of divine power, appointed by God.