The purpose of having both Lady Macduff and Macduff is to show two things. One is the depth of love that Macduff has for his country. In a time when nothing is safe, Macduff has left a loving home to do what he thinks is right. Lady Macduff, in contrast to Lady Macbeth, is a witty and intelligent woman who clearly loves her husband. When the murderers ask when he is, Lady Macduff responds (even in her anger at him):
Lady Macduff: I hope, in no place so unsanctified
Where such as thou mayst find him. (4.2)
Her son is also intelligent and loyal to his father. The light-hearted joking of mother and son in this scene illustrates their intelligence and the pleasant atmosphere of this home. The determination of Macduff's son to preserve his father's good name is shown in his confrontation with the murderers:
First Murderer: He's a traitor.
Son: Thou liest, thou shag-hair'd villain! (4.2)
Macduff's loyalty to his country must be strong for him to leave this home.
Finally, the introduction of the son in particular is to demonstrate to the audience how evil Macbeth has become. Not only does he send murderers after those people who are a direct threat to him, he goes after the families as well--including innocent children. Macduff's attempts to defeat Macbeth are now fully justified.