The phonetic bits, for example, are based on how Japanese speakers of the time thought the equivalent Chinese sounded, with allowances for Japanese and Chinese having radically different phonics. And then you do that a few more times because the language both evolved in parallel, and you end up in a situation where each kanji can have more than one phonetic representation based on the original Chinese pronunciation. It can also have a phonetic representation based on the Japanese word that means the same thing, which will invariably be something radically different since Chinese and Japanese aren't terribly closely related languages.
So while they might be using the same writing system, the fact that it's a fairly elegant writing system for Chinese doesn't imply that it's elegant in Japanese. Not any more than the Roman alphabet being a very good writing system for Latin implies that English's writing system isn't a bit of a mess.