It always seemed weird to me that it would be formally developed so late. Like I've taken multiple trigonometry courses and can't even define trigonometry let alone make sense of most of it, but the Pythagorean theorem is a purely intuitive thing everyone does regularly. The first person to take a diagonal shortcut while walking understood it. It should have been the first thing mathematics codified after basic arithmetic.
There is lots of evidence of the Pythagorean theorem before Pythagoras. The attribution of the rule to him comes centuries after he lived. So likely he worked on codifying and proving the relationship using the Greek deductive and axiomatic system.
I imagine it's been developed and lost periodically, and some people are averse to irrational numbers. Greece just had continual credit in our intellectual pedigree (as opposed to, say, the Babylonians who had more advanced trig than the Greeks before them and the Greeks were aware of them in some ways).
I think you also need a lot of rectangles and squares to find it necessary. I imagine buildings, but even today a lot of materials are cut to fit (also, the building I am in is not rectangular along any dimension). Maybe legal rectangular plots of land? Idk