Most bets are on high ISO settings that caused the graininess. There are two types of night shots you can take - one is more for still scenes or ones in which some motion blur is acceptable or desired, the other is for movement or action that you are trying to freeze without blur.
Type 1 is the most clean, vivid looking night shot, that most people favor and are likely talking about when they say 'night shot'. These are smooth, saturated, and lovely. And in order to do these, you need to set the camera to the LOWEST ISO setting, use a longer shutter speed usually measuring in the seconds, and you need to use a tripod or lay the camera on a level surface. Anything that moves will blur - but generally taking landscape type shots like your first one, you'd come out great unless it was a very windy night. Also, this technique would work with the fireworks, as often seeing the smooth streaks of light eminating out from the burst is a desirable effect. Car taillights will blur into long streaks, people will become streaky ghosts, etc.
Type 2 is for when you are taking candid type street shots, or trying to freeze a moving object. This might be a band playing at night on a stage, a person walking or moving where you do not want them to blur, or where there is lots of movement within the shot that you need to be sharp and distinguishable. For these shots, you must make compromises - in order to get that detail without blur, you need fast shutter speeds. In order to get fast shutter speeds, you need the sensor to find more light. A lens with a nice wide aperture will certainly help, which is why F1.4 and F1.7 lenses still sell well. But even those wide apertures can't find enough light at night...so you have to turn up the sensitivity of the sensor. Much like turning up the gain on a mike, or squelch on a two way radio, you introduce static or noise. In this case, graininess or noisyness in the shot. ISO is your 'gain' - turning up the ISO turns up the sensitivity. Most DSLRs are fine through ISO400...then at ISO800 start to get a bit more noise creeping in. At ISO1600, most DSLRs will have a fair amount of noise, but still plenty usable. Anything higher will likely have a lot of noise unless you're shooting high end full-frame sensors.
My guess is that you had high ISO on all those shots - at least 400, and maybe up to 800 or so. That's going to introduce some noise, and it also sometimes affects the saturation or color in the shot.
There are tons of aftermarket noise reduction tools you can buy that will effectively remove that noise from your shot - Neat Image, Nosie Ninja, Noiseware, Topaz DeNoise, Helicon Filter, Nik DFine, etc. Most are plug ins for post-processing software like Photoshop and Paint Shop Pro, but some are available as standalone programs as well.
Hope that helps!