This opens a Pandora's box (the spell checker insisted on a capital "P" for Pandora!) Here are some facts using your excellent example of Matt 3:16, 17.
- The 1526 edition of William Tyndale's translation does NOT capitalise god, spirit nor sonne. [Even in the Greek the definite articles before these words in these verses varies between early manuscripts - check UBS5 and NA28]
- The 1611 KJV does capitalise all these words
- The original manuscripts used uncial (ALL CAPITALS) script and so no distinction is made
- during the second century the widespread use of "nomina sacra" arose (see https://en.wikipedia.org/wiki/Nomina_sacra for more information) However, it is not clear if the autographs used such a practice to distinguish divine names.
The modern use of capitalisation as a mark of respect for a sacred name is widespread but not universal and some instances are far from clear. Most would agree that "the Holy Spirit" should be capitalised because it contains the Greek definite article, but, there are numerous places where the article is missing and most translators will supply one. For example, how should Matt 26:41 be translated? Some have it, "The Spirit is willing …" despite the absence of the definite article which would make the literal rendering, "[a] spirit is willing..."
The same is true of God/god. For example, how should John 1:1 be translated? David Bentley Hart's translation gives "...the Logos was present with God and the Logos was god." He argues that the final use of "theos" is a classic Greek category statement because it lacks the definite article. (See his extensive discussion about his translation approach.)
All this boils down to the beliefs and interpretation of the translators and when they believe a sacred name is in view. The NIV - if you look carefully - regularly translates "Spirit" and footnotes with "or spirit" because it is not clear to the translators.