Macbeth feels guilty for killing Duncan because Shakespeare is trying to capture the humanity of ambition.
Macbeth does not want to kill Duncan at first. He does want to be king, and is pleased with the witches’ prophecy. However, he also has to fight his own ambition.
Stars, hide your fires;
Let not light see my black and deep desires:
The eye wink at the hand; yet let that be
Which the eye fears, when it is done, to see. (Act 1, Scene 4)
This is one of the reasons why Macbeth has to face himself. He decides to kill Duncan only after he works through his thoughts, including the fact that Duncan is his cousin, is a good king, and is his guest.
Macbeth therefore feels guilty before he even kills Duncan, and he only gets the nerve because he sees a floating dagger and Lady Macbeth makes the plan for him to follow.
After the murder of Duncan, Macbeth does begin to show signs of guilt. He imagines he hears the guards saying he is a murderer. He sees Banquo's ghost. He also seems to regret his wife's death. The effects of his ambition are mostly disastrous.