I think the joke is supposed to be that B.C. doesn’t know what the outhouse is for, and only equates the moon-symbol on the door with the same shape of the moon up in the sky, and then enters it (possibly as some kind of primitive rocket-ship joke or something) only to find that “it stink(s) in here”.
I don’t think that there was any hateful or malicious intent on the part of Mr. Hart, with he himself not only flat-out denying it but also doing so in a way that seemed to indicate shock and disbelief at the very idea in the first place, ie: he didn’t even make the connections until it was directly pointed out to him as a result.
Yes, from a certain point of view this comic certainly can be seen as an inflammatory and derogatory statement against someone else’s belief systems, IE: a shadowed, “dark-skinned” man wanders into the house with a crescent moon-shape on it in the middle of the desert, and closes the door with an “I”-shaped SLAM sound effect, only to find that “it stink(s) in here”.
But taken apart piece-by-piece, each of the individual elements of this strip, from the outhouse, to the moon in the sky, to the vertical sound effect, to the usage of the sound effect itself in place of visual drawn action, and yes, even the lame punchline itself, have all been previously established well within the series.
And TBH, the moon without the iconic star indicates Islam as much as the cross without the horizontal T-bar indicates Christianity or the star minus one of the three-pointed triangles indicates Judaism.
He might be preachy or seemingly-proselytizing at times (though not as deliberate as some cartoonists), but Johnny Hart is not a one-track mind (or at least doesn’t seem to be), with “God” sometimes being a periphery to the joke-at-hand (“Wal-Mart having a sale on vistas”), if not an afterthought or even a punchline itself. And when he does start preaching, it’s usually very out-there-in-the-open and overt, like almost everything else that he does 
On the flip-side of the coin, this comic could even be taken as pro-Islamic, with the commentary being that Man (as symbolized by B.C. himself) is in a dark and smelly shithole of circumstances called Life, and that Islam (represented by the light of the Moon shining through the Moon-shaped hole in the doorway) is there to show us the way out…no?
In the end, crude, ego-centric and/or ignorant humour has always been at the heart of B.C. with strips on everything from the sun “revolving around the United States” to a tepee-living Indian giving Peter “wampum” to ahem…“wampum” a bear…over the head…with (yeah, that hurt as much to explain in print as you’d expect it to); cue rim-shot.
Sideline: Oddly enough, the controversy over the ‘infamy’ storyline-gag involving Toyota was pulled more for the fact that it made light of the American losses at Pearl Harbour than for the fact that it could be taken as anti-Japanese…which is exactly the wrong of those two reasons why it should pulled, imo :S