In our Solar System, all the gas giants have ring systems. However, why do these rings form rings and not a cloud of debris around the planet?
There are different theories as to how planetary rings form, and so there are different answers to your question.
One theory of planetary ring formation is that a small (or large, depending on the ring size) moon wandered into the gas giant's Roche limit (the radius from the celestial body inside which no second celestial body can stay intact due to tidal disruptions by the larger body). The moon would have been orbiting the planet, and would thus have been moving in a flat . The resulting debris continued to move in a plane; if it had been angled, collisions would have flattened it.
Another theory is that the debris is left over from the early Solar System. A protoplanetary disk formed around the Sun; it contained all the material that makes up the planets. Over time (and through a lot of collisions!), bits of the material slammed together and formed planets. The trouble is, not all of that material became planets. Some became asteroids, some became comets, and some became moons (although the theory of the formation of the Earth's moon is a bit different). Some of this material could also have coalesced around planets.
Now, the protoplanetary disk would already have been in a disk shape. Why? Think of a rotating object - like a planet. You might have read that the Earth is not a sphere. Aside from the obvious deviations of mountains and valleys, some of the deformation comes from the Earth's rotation. Any rotating body will bulge a little around its equator; a spherical body will become an oblate spheroid. The same thing happened for the protoplanetary disk - it became a disk because it was rotating! Any material that coalesced around planets would already be in a plane - that's why the planets' orbits aren't at odd angles to each other. So this material would be in a flat shape if it was captured by the planets, and would become a circular ring because of rotation. If, at that point, there was material that wasn't in a flat plane, it would become flat by the same process that made the protoplanetary disk flat.
There are stellar systems where the protoplanetary disk isn't in the same plane as the star's rotation. This could affect planetary orbits; however, such systems have not been thoroughly studied because of their rarity.