Shakespeare believes the best rulers follow Platonic or idealist precepts, not Machiavellian precepts. The play, in fact, could be understood as a face off between Macbeth's Machiavellian instincts to behave barbarously while pretending to be virtuous and Duncan's sincere virtues. Macbeth only cares about power, while Duncan cares about his homeland.
In the discussion between Malcolm and Macduff, Malcolm is discussing leading an uprising against Macbeth. First, however, he wants to test Macduff's loyalty to Scotland. He does this by pretending he is as terrible a tyrant as Macbeth. At first, Macduff is so desperate to get rid of Macbeth that he is able to use Machiavellian thinking to reason that Malcolm could get away with crimes, like sleeping around and robbing the royal treasury, while still seeming virtuous to most people, and therefore be a successful ruler. Then Malcolm states:
The king-becoming graces,
As justice, verity, temperance, stableness,
Bounty, perseverance, mercy, lowliness,
Devotion, patience, courage, fortitude,
I have no relish of them but abound
In the division of each several crime.
At this point, Macduff recoils and cries in anguish for Scotland. This is what Malcolm wants to hear. A truly good and virtuous leader, he wants his followers to put loyalty to Scotland ahead of loyalty to him. Unlike Macbeth, or any Machiavellian leader, Malcolm places the needs of his country over his own needs.
Malcolm, having established Macduff's allegiance to his country, not to him, then tells him that he is truly a good person, one who has thought about what it means to rule, and one who cares deeply about Scotland and its people. He establishes himself as a Platonic leader who will truly care about being an ethical king. This does not mean that Shakespeare would not accept some Machiavellian behavior, as he does in other plays, but that the best king is a moral king.