Malcolm advises Macduff to go out and fight to help place Malcolm on the throne. All Malcolm sees in Macduff's suffering is an opportunity to gain an ally.
Malcolm wants Macduff to take revenge on the murderer, who happens to be Malcolm's enemy Macbeth. In this respect, Malcolm resembles Claudius in Hamlet, who uses Laertes' desire for revenge for his own personal ends.
Killing Macduff's family causes Macduff to become more determined to seek revenge on Macbeth, as it increases his personal vendetta against him. This act also leads Macduff to join forces with Malcolm and the English army to overthrow Macbeth's tyrannical rule.
Macduff pratically deserted his family. Instead of being with them, he went to England to find Malcolm and convince him to come back to Scotland and be the king. While Macduff was in England, Macbeth ordered the assassains to go to Macduff's house and murder him and his family. Macduff wasn't there to protect his family. Macduff's flaw is that he cared more about his job/Duncan's death than his own family. He went to England without telling his family so they were killed.
Malcolm is testing Macduff's integrity. If Macduff had embraced Malcolm's worldly, unethical responses, Malcolm would not have trusted him enough to form an alliance with him. When Macduff wails at the imminent hopelessness of Scotland, Malcolm knows he is in the presence of a good man, and he reveals his own "innocence" and stalwart loyalty to Scotland and to God.
It's a two-part answer. One, Macbeth is a traitor and killed the King of Scotland. Macduff is loyal to the rightful heir, Malcolm. Macduff assists Malcolm in the retaking of Dunsinane castle and murders Macbeth. But Macbeth also hired assassins to have Macduffs family murdered. Macduff's wife and children were all murdered after he fled to England with Malcolm.
Ross told Macbeth that he was now the thane of Cawdor just after the 3 witches made that prediction
Macduff and Malcolm plan to overthrow Macbeth in England.
Both Malcolm and Macduff believe Macbeth is a tyrant to be overthrown. However, Malcolm is a tyrant himself, if not even more repulsive than Macbeth. Though Macduff is not fully aware of this fact. Malcolm manipulates Macduff into slaying Macbeth and then plea allegiance to himself as the King of Scotland.
By not committing to join Macduff in overthrowing Macbeth, Malcolm gains the opportunity to test Macduff's loyalty and dedication to the cause. It also allows Malcolm to assess Macduff's character and leadership abilities before fully trusting him in the rebellion against Macbeth.
Unlike his father who trusted too easily, Malcolm does not trust Macduff. He does not trust him because he thinks that Macduff may be secretly working for Macbeth. To test this theory he rambles lies giving examples of how he is not fit to be king. However, it is Macduff's polite reaction of disagreeing with Malcolm which makes Malcolm believe Macduff.
Malcolm trusts Macduff because he demonstrates his loyalty to Scotland and his opposition to Macbeth by joining forces with him to overthrow the tyrannical ruler. Macduff's courage and dedication to the wellbeing of Scotland earn Malcolm's trust and respect.