There are probably hundreds of pieces of music written specifically for the British monarchs or their family members. The most famous among them are probably the Handel pieces mentioned in another answer, along with the four coronation anthems, commissioned for the coronation of George II. I would also mention a recent favorite of mine, Handel's Ode for the Birthday of Queen Anne. This was written to commemorate the Peace of Utrecht, as were the Utrecht Te Deum and Jubilate.
It should not be surprising that many other composers have also written coronation anthems, frequently using the same texts. From Wikipedia:
Coronation anthems by other composers
The genre of coronation anthems was not exclusive to Handel. Coronations included up to twelve anthems and used formulaic coronation texts —starting with the anthem for the procession at the beginning of the coronation ceremonies (usually "Oh Lord, grant the King a long life"). Other composers to have produced anthems used during the coronation service include:
- Thomas Tomkins who wrote anthems for the 1626 coronation of Charles I, including a setting of Zadok the Priest.
- Henry Lawes who wrote a setting of Zadok the Priest for the 1661 coronation of Charles II.
- John Blow, may have set I was Glad (the sources are ambiguous whether this was by Blow or Purcell).
- Henry Purcell, who produced I was Glad (unless it was by Blow) and My Heart is Inditing, among others.
- Francis Pigott, wrote a setting of I was glad for the Coronation of Queen Anne in 1702.
- William Croft, wrote The Lord is a Sun and a Shield for George I.
- William Boyce, commissioned by George III to write all the music for his coronation, but asked for (and was granted) permission to reuse Handel's setting of Zadok the Priest, as he felt it couldn't be improved upon.
- Thomas Attwood, who contributed I was glad for George IV of England's coronation in 1820, Oh grant the King a long life for William IV of England's coronation in 1830 and finally began a third anthem for Queen Victoria's coronation in 1838 but he died three months beforehand and it was never completed.
- William Knyvett wrote This is the Day that the Lord hath made for the 1838 coronation of Queen Victoria.
- Sir Hubert Parry, whose I was glad was composed for the coronation of Edward VII in 1902.
- Sir Frederick Bridge wrote Kings shall see and arise for the 1902 coronation.
- Sir Edward Elgar, who wrote O Hearken Thou for the 1912 coronation of George V.
- Sir Henry Walford Davies, who wrote Confortare (Be strong and play the Man) for the 1937 coronation of George VI
- Ralph Vaughan Williams, who composed a Festal Te Deum for the coronation of George VI and the brief meditative O taste and see for the coronation of Elizabeth II in 1953.
- Herbert Howells, who wrote Behold, O God our Defender for the 1953 coronation.
- Sir William Walton, who wrote a Coronation Te Deum for the 1953 coronation.
Healey Willan wrote an anthem O Lord our Governor for the 1953 coronation.
Many of these composers, like Handel, enjoyed one form or another of royal patronage. Some were gentlemen of the Chapel Royal, and any service music they wrote for the chapel would of course also be associated with the royal family. For example, John Blow "wrote fourteen services and 30 odes for royal celebrations."
There were also non-liturgical commissions. For example, Blow also "composed a two-part setting of Robert Herrick's Goe, perjur'd man, written at the request of Charles II to imitate Giacomo Carissimi's Dite, o cieli."