Although feathered dinosaurs are pretty much a given now, many people still wonder why flightless dinosaurs would have sported feathers. The answer is probably, "The same reasons avian dinosaurs (aka birds) have feathers." For instance, Scott Persons—a University of Alberta PhD candidate—has determined that some dinosaurs likely used their sexy, sexy tail plumage to attract mates, much like peacocks do today:
Persons studied the tails of oviraptors, a group of dinosaurs that had beaks and feathers. Previous research has shown some feathered dinosaurs used their plumage for insulation and flight. Oviraptors could not fly but Persons said their tail feathers were used in much the same way as a peacock...
Previous research has shown other dinosaurs also possessed display structures, such as the small crests over the eyes of Tyrannosaurus rex, showing the animal had “sex on the brain,” Persons said. In a study published last year, a University of Calgary paleontologist found another group of dinosaurs also may have sprouted feathers as a secondary sexual characteristic.
Persons’ research focused on the tails of oviraptors. He found the vertebrae in the tails were tightly pressed together while the joints between the vertebrae were flexible. The vertebrae also had wide attachment sites for muscles that would allow the dinosaurs to raiseand twist their tails. At the end of the tail was a fusion of vertebrae that formed a ridged, blade-like structure called a pygostyle, which acts as the anchor for a fan of feathers in modern-day birds.
You can read more about dinosaur tail feathers here and here.