It's not so much about animal welfare. If there's a trade-off to be made between economics and animal welfare, the economics usually win out. Cattle would prefer to graze low density pastures, for example, but that's not compatible with the economic realities of modern dairy and it ends up limited to an insignificant portion of the market. Robots and automation solve problems for both the livestock and the dairy, so they're common.