Lore Implications

Despite all courses in Super Mario 64 taking place within paintings, there's a level of cohesion within the locations that Mario explores within his first N64 outing. Given the fact these locations exist beyond the paintings that lead to them, as revealed with the physical connection between several levels and the Mushroom Castle as well as Whomp's Fortress reappearing Super Mario Galaxy 2, it's likely that the connections and implications between the design of these courses are more intentional than coincidence.

Invasion Prelude (Dire, Dire Docks)
Dire, Dire Docks is the only course that has a warp directly to the Mushroom Castle, this trait only shared by secret levels such as Cavern of the Metal Cap and Wing Mario Over the Rainbow. The level serves as a underground dock for Bowser's submarine, presented prominently within the first mission. When Mario collects the star in this mission, the submarine vanishes and the tunnel to the castle moat is opened.

Given this course appears to be a dock for a submarine that goes unused within the game's main story, and that there's a passageway that leads directly to the Mushroom Castle's moat, it could be presumed that the submarine in this level was used by Bowser and his minions to infiltrate the castle.

Warring Factions (Bob-omb Battlefield)
Bob-omb Battlefield, while still following the stereotypical Mario formula of a grassy first level, provides an interesting setpiece as the course presents the story of two warring races of Bob-ombs, black and pink. Black Bob-ombs act as enemies to Mario and are under the rule of Big Bob-omb, who would become a recurring villain in Mario spin-offs. Pink Bob-ombs on the other hand are friendly to Mario, asking for his help.

The land belonged to the pink Bob-ombs originally, as the land is littered with cannons that are associated with the pink Bob-ombs in other levels. It's likely that Big Bob-omb and his legion of black Bob-ombs managed to take over the land, as well as rewiring these cannons to fire water bombs. Perhaps the usage of water bombs in combat are to prevent the pink Bob-ombs from exploding, which would be their only method of attack.

Super Mario 64 is the first game in the series to introduce other rulers in the Mario series, and it started with Big Bob-omb in this course. Later renamed to King Bob-omb further into the series, there's likely an allegience between him and Bowser. This is evident with Goombas and Koopa Troopas being present in Bob-omb Battlefield, as well as Bob-ombs becoming a more prevalent enemy in Super Mario 64.

The Big Dud
Only in Super Mario 64, Big Bob-omb never appears at the top of the mountain after his defeat in the first mission. One of the pink Bob-ombs in the second mission will say "the Big Bob-omb is nothing but a big dud now!". Coincidentally in the same mission, a third Big Steelie is added to the ditch at the bottom of the mountain. Big Steelies share the same graphic with regular Bob-ombs, potentially implying that Big Bob-omb's body is left rolling at the bottom of the mountain as a "dud". Whether this is an intentional addition to the story or developers just filling up a vacant object slot is unknown.

Caged House
Big Boo's Haunt is the only level that isn't entered through some sort of obscuring warp. Instead it's accessed through a tiny cage in the Courtyard, having to be freed from a Boo. As Mario jumps into the cage, his model shrinks to indicate he's growing smaller to journey through the mansion inside.

The reason for this bizarre level entry remains unknown to this day. While size change is a common theme in the Mario series, nothing quite like this has ever happened within a mainline platformer before nor since. It implies something greater, as if the mansion was intentionally this small, like a doll house of sorts.

If Big Boo's Haunt is truly a small house within a cage, it implies that the skybox of the stage is actually just large blades of grass, as opposed to several dead trees as many predicted.

Castle Graveyard
Oddly, the Castle Courtyard is the only area in the castle where enemies are present, being the ghostly Boos. Since they're supposed to represent the undead, it could be presumed that these Boos are the ghosts of dead people (presumably Toads), possibly buried within the Courtyard.

It's interesting that the Courtyard is also home to the Eternal Star Statue, which is closely tied to Luigi. This indicates the link between Luigi and Boos, which was truly established in Luigi's Mansion in 2001, was possibly planned much earlier than expected. However, a statue dedicated to Luigi also implies that he might very well be dead, as a sort of grave to Luigi. After all, why else would a plaque dedicated to Luigi be in the Castle Courtyard?