In a word, the most significant answer to your question is SUSPENSE. Shakespeare was a dramatist, and like any good dramatist, he knew that one of his most important tasks was to keep the audience asking, "What happens next?" Suspense is a great way to achieve the desired result of having the audience on the proverbial edge of their seats.
The scene in the play that your question refers to is Act II, scene ii. Let's look at the way that Shakespeare creates suspense here in this scene, including not showing the actual murder.
For one thing, he includes ominous noises, or at least the suggestion of noises that are "heard" by the characters onstage. This is a tried-and-true device of suspense, and, if you're a fan of horror movies, I'm sure you'll find an exchange similar to the following in most of your favourite films.
. . .Didst thou not hear a noise?
. . .Did not you speak?
As I descended?
Who lies i'the second chamber?
This is a sorry sight.
This exchange happens just after Macbeth enters from killing Duncan. Shakespeare has put the focus on the anticipation of whether they will be caught or not, rather than showing you the gory act itself.
But, Shakespeare wasn't holding back on the idea of gore. He knew that his audience loved that too. So, once he has milked the suspense of the act happening offstage, he moves on to the gore. And that is why, as I have reprinted above, Macbeth looks at his hands and says, "This is a sorry sight." His hands are covered in blood. In fact, he, himself, might be covered in blood. An audience that sees all that blood can probably recreate a much more gruesome murder in their minds than could have been displayed onstage.
So, the creation of suspense and the horrible imaginary murder an audience can create in their minds are the two reasons that Shakespeare chose not to show the murder directly to his audience.