This can be explained as a continuation of an old rule that said that only living beings (marked by endings such as -us, -a; -i, -ae) could be "active" subjects.
A "thing" doesn't have agency; it can't "do" anything to something or someone else – in other words, it can't be the subject of a transitive verb. It can only be either the subject of an intransitive verb, or the object of a transitive verb – and thus in Latin takes the endings -um, -a in either event.
Bonus amat bonum: The good (man) loves what is good. (Meaning 1)
Bonus amat bonum: The good (man) loves the good (man). (Meaning 2)
Bonum est bonum: What is (a) good (thing) is good.
This is exactly the same pattern as in ergative grammar: the object of a transitive verb has the same case as a thing that is the subject of an intransitive verb.