It's because of backward compatibility, mostly. Windows is based on DOS, where extensions were important. Just a different design philosophy...
Plus, in Linux there's 'file' command. Even when you don't give a picture an extension, when you run 'file imagename' you'll be told which picture format it is. It makes writing programs chooseing the right method to deal with a file easier.