Technically, Pythagoras did not think up the theorem. Nor did he prove it. Nor did he exist in the first place. But: had he existed, and had he known about the theorem, he would probably have been last person on earth to realise it. Thus it is logical that it is named after him.
In fact the Pythagorean theorem was known by many people before the Greeks, eg the Chinese and the Babylonians.
There is no evidence that it was known to the Egyptians though, a popular myth that has also been noded here. It appears, however, that they did know that triangles have three sides, and in the early 20th century a Belgian historian concluded that they might have known the Pythogorean theorem. After a few references that nobody bothered to check this became an accepted truth.