I think all three cases backtrack to the gender system of Early Proto-Indo-European. In Early PIE there are only two genders - animate and inanimate. Eventually the inanimate became the neuter, as the animate split into masculine and feminine. But the association between thing and the neuter remained in the IE languages, as a leftover of the past.
[It’s kind of off-topic, but]
I think all three cases backtrack to the gender system of Early Proto-Indo-European. In Early PIE there are only two genders - animate and inanimate. Eventually the inanimate became the neuter, as the animate split into masculine and feminine. But the association between thing and the neuter remained in the IE languages, as a leftover of the past.
Silvia Luraghi published a really good paper about this.