I like the answers provided by @userLTK and @MarkOlson but let me add my own phrasing here.
The shape in each case is given by the particular characteristics of the scenario.
An irregular shaped nebula is a bunch of gas and dust only very loosely bound by gravity, or unbound. There's not much overall angular momentum (the whole thing is not spinning, typically). It's just a sparse pile of random stuff thrown out by a stellar explosion or something. The shape can be anything, depending on how exactly it came out to be. It could be slowly expanding.
An accretion disk is different. The stuff is bound together by gravity - perhaps the overall density of the cloud is greater, perhaps there's a dense chunk in the middle (protoplanet or protostar), perhaps both. Each bit of cosmic junk is orbiting the common center of mass - bound by gravity. You would think the whole collection could be spherical, but that only lasts for a blink of an eye: particles in the cloud collide with each other all the time, and whichever direction has the most angular momentum ends up winning in the end, so all particles will rotate more or less in the same plane; heretics will slam into the disk and join it in the end; within the disk there are far fewer collisions, so the disk configuration is more stable.
A planet is basically a giant pile of stuff that behaves, at the macroscopic level, like an incompressible fluid. Even "rocky" planets behave like fluids at the scale of the whole body. Of course, as with any fluid, gravity will eventually pull it into a spherical shape. If there's any angular momentum, the sphere will be squished a little, but most planets are close to a perfect sphere (extreme angular momentums are rare).