I am kind of lazy, so a lot of times the spells will come from the bonus spells lists of classes. Wyrmlings can cast the 3rd level bonus spells (each once per day); young dragons get the 3rd (3 times per day) and 5th (each once per day); adults get 3rd (at will), 5th (each 3 times per day), and 7th (each once per day); and ancients get 3rd and 5th level (at will), 7th (each 3 times per day), and 9th (each once per day).
In my setting, dragons change color/type after they brumate (hibernation for reptiles) and when they shed, change age categories, or have the urge to mate. Their spells reflect this.
Whites want to get away from other sentients and use the Polar Land Druid spells to make things miserable for anyone who enters their territory.
When a dragon is going to shed, its scales turn black, and it heads to the nearest swamp to ease the itch. They want melee combat to help get those scales off, so they don't bother with spells.
Green dragons come about when a dragon brumates too close to a Shadowfell portal. Gloom ranger doesn't quite fit, so I give them Trickery Domain spells.
Blue dragons are when a dragon gets the mood to breed and raise offspring. They tend to congregate in large groups to watch over eggs and wyrmlings. In any group, there is one who can cast Life Domain Cleric spells, but honestly, 20 adult (or older) blue dragons don't need a lot of spells to deal with any problem.
Red dragons come about when a dragon wakes up and feels the need for a bigger lair with more treasure. They also want everyone to know about it. Oath of Glory spells are good for these egomaniacs.
Brass dragons come about when a dragon wakes up curious about something. The either use Light domain spells (or if you are unfortunate), Great Old One Warlock spells AND Sorcerer Psionic spells. You are usually better off with a Red dragon.
When a dragon brumates too close to a Feywild portal, they go Copper. It is considered very rude to tell a dragon about anything it did as a Copper. They use Archfey Warlock spells.
Bronze are the opposite of whites, they want to immerse themselves in the lives of humanoids. Ports are good places for new "people" to come in and not attract attention. Bronze's use Circle of the Sea spells to avoid changing into their true forms.
Silver dragons wake up with strong religious convictions. Local priests usually go from "hey, this is great, a powerful member of the congregation" to "that dragon has taken over the church" pretty quickly, unless there is some menace that the dragon can take care of. They tend to go for Oath of Devotion, unless the nearest church has been destroyed or the local faith is oppressed, then it is Oath of Vengeance.
Golds tend to want to fix things for the poor, weak humanoids near them (for them, that is all humanoids), sometimes for the best, and sometimes not. Occasionally my parties, thinking the "power behind the throne" is a lich or a rakshasa, find out it is a Golden dragon. They usually use the Sorcerer Clockwork Spells.