Ants and bees build hives after all. Trees build, well, trees.
It's just that for biological systems, it's relatively easier to build legs than wheels. And as you suggest, wheels need more infrastructure to be really useful. So even if you could solve the free-rider problem completely (which you can't), it would still cost biological systems more.
Yeah but those ants or bees are not competitors with each other, neither are cells in a tree. All organism you described have a strong separation between reproductive parts and the ones which build infrastructure.
Similarly to how the cells in your bones and muscles don't reproduce.
This is one of the ways biology can work. And it's not in contradiction to what I wrote. Just the opposite.
Though to go a bit deeper: plenty of other creatures derive advantages (and disadvantages) from trees. But for making the biology work, the advantages to the tree genes just have to outweigh the disadvantages to the tree genes.
Earth biology doesn’t seem to have invented powered rotary motion around an axle, that I’m aware of, but I don’t see any reason why it could not have.
And biology has inspired many inventions that have been analogs rather than copies, eg flight.
I don't think we should worship biology like it's some miracle process with infinite wisdom. It makes sense to look to nature and biology for solutions when the engineering parameters are aligned (see wood, an excellent material that has impressive properties.) Otherwise, a lot of things that we retrospectively attribute to being inspired by nature are merely convergent designs (there aren't many ways to make something aerodynamic, if you would be surprised)
EDIT: I misread your post and I thought you were saying that wheels and axle were from biology. Sorry about that.