Early in The Sandman comics, we see appearances from the Justice League, Gotham, Arkham Asylum, John Constantine and others. As the series progresses we see fewer and fewer cameos. Did Gaiman ever address why this was? Was it a directive from DC, a story-based decision, or something else?
Originally, Sandman was conceived very much as part of that world. (Gaiman had originally intended to revive the 30s pulp character with the gas mask - who of course makes a brief cameo in book one of Sandman, and whose revival later happened as Sandman Mystery Theatre.) It was Karen Berger's suggestion that he create a completely new character.
So as designed, the Sandman was not a superhero story, it was a horror story set entirely in dreams - a genre in which superheroes don't really fit well. In the early issues he was still experimenting with genres, and each issue is a slightly different kind of horror or dark fantasy - but they're all essentially horror/fantasy stories.
In the afterword to the first book, Gaiman describes the issue in which the JLA appear, "Passengers", as "my (perhaps misguided) attempt to try to mix super-heroes into the Sandman world."
So it seems pretty clear that Gaiman made an early attempt to mix them in, decided it didn't work well, and left it at that. (He throws in the occasional cameo when they're actually a useful fit for the tone of the story; most notably in "Facade". But that story is itself about the contrast between a realistic world and the simpler tone and assumptions of an archetypal superhero story.)
To offer another look on the issue - Neil Gaiman explained in an interview with Chip Kidd that there was also the concern for continuity with other DC comics. It turns out that in the issue where Dr. Dee escapes from Arkham Asylim (in #5, "Passengers"), it was supposed to be the Joker, and his April Fool's joke (hanging himself), rather than Scarecrow.
However, Gaiman was told that Joker had just died in another comic, so he couldn't appear in The Sandman. In this light, Scarecrow saying
If you see the Joker, tell him to hurry back. It isn't April Fool's Day without his little jokes...
gains another meaning (we that @Shokhet for spotting that interpretation).
Gaiman explains that he ran into similar problems multiple times (in The Wake, Superman was originally to have his cape stick out of his cloak, and constantly look back at it afraid, it would expose him), and the issues - having to synchronise the continuity of The Sandman with another comic, and having to approve it - was too much hassle.
This is the interview (the relevant portion starts at 57:32):