Really good question. I always wondered about it myself for a few subsequent years in the past, I thought there was some legit reason behind this, but there really isn't.
I think the answer is rather simple, and a lot of answers are not really digging into the issue.
If your language allows to draw piexel on screen then it is 100% possible to create a gui framework based on it which will mimic Windows form controls looks & feel precisely.
Since Java is crossplatform its also entirely possible to make sure that based on actual running system type (Mac/Windows) UI would choose to look different on both platforms, matching the runtime platform style.
As you can see in XAML for example UI can be easily presented in very structured form and language. Choosing the "native" behaviours is also possible if time is taken to do this.
So it would be possible to create GUI framework which would allow Java developers to get applications which would look native on Mac and Windows.
So we get to Swing, thats just one GUI framework out of potential infinity of GUI frameworks which could be created for Java. It behaves how it was programmed, which doesn't follow the above process and you get weirdly looking apps on both systems. Thats the choice made by Swing developers, noone forced them to do this and to behave that way.