Basically once phonetics had got going it became necessary to create a single written representation of sounds that was independent of any particular language, accent/idiolect and spelling system. This is because neutrality is important to avoid bias and because phoneticians need to learn one system and be consistent with it rather than fiddle around with lots of different ones, confusingly. It’s also a fact that whatever the ‘official’ or standard pronunciation of a language is there are many accents and idiolectal variants and a code that focuses on the sound per se enables that to be recorded and understood.