Here’s the Wikipedia article on the flag, which is quite extensive: https://en.wikipedia.org/wiki/Flag_of_Washington,_D.C.

The flag is based on the coat of arms of the Washington family, which had used it since the 14th century. Here’s an 14th century stained glass window in Selby Abbey featuring the coat of arms:

Washington CoA stained glass

The flag is a much later creation, though. Not until the 1920s, discussions started about a flag for the city. Then, it was very close that Washington D.C. got a different flag. A 1924 proposal looking like was approved by the senate, but never passed into law.

Washington DC flag proposal 1924

Not until 1938, the question was brought back, and the current flag was adopted in 1939.