Dialga is derived from diamond.
Palkia is derived from the Japanese spelling of pearl...
These two were very much intentional.
Xerneas comes from the letter X.
Yveltal comes from the letter Y.
These two also seem intentional.
Solgaleo is based off the root sol, the Sun. Lunala is based off luna, the Moon. So those two are probably intentional as well.
Game Freak probably just wanted to correlate the legendaries with the game titles, so they sounded better together. There are of course exceptions, though (Zacian, Zamazenta, Giratina, Groudon, Kyogre, Rayquaza). However, those still relate to the game they represent in some way.
Source
Source
Source
Source
Hope I helped!