It is very possible that feathers began their evolutionary trek as insulatory structures. Large non-avian dinosaurs, like large mammals, probably did not need much insulation. This is especially true of those non-avian dinosaurs that lived on Antarctica, Australia and northern North America, close to the poles. It is not, then, a long leap of logic to hypothesize that dinosaur insulation took the form of feathers or something similar. Any structure that would allow dinosaurs to maintain their body heat with lower energy cost would have given them an even greater competitive advantage.
Avian feathers are incredible display structures, especially in terms of colors.
These structures allow the birds to attract mates and to serve as threat display to rivals, and in rare cases act as camouflage when the flora is also extremely colorful. Shape also can play a part, as it does in peacocks. As reptiles, birds have superior color vision compared to mammals, and any structure capable of superior color display would very likely become set in the population through sexual selection, regardless of its other advantages. Non-avian dinosaurs, with the same superior color vision, may also have used such structures for display purposes. Avian feathers are incredible camouflage.