Side effect seems like an odd way to describe what’s going on when these functions are required for a company to operate.
Companies don’t survive if nobody is paid to show up every day or if they keep paying every single ex employee that ever worked for the company. It’s harder to attract new employees if you don’t offer competitive salaries or benefits. HR is a tiny part of most companies, but without that work being done the company would absolutely fail.
Similarly a specific ratio of flight attendants to passengers are required by the FAA in case of an emergency. Airlines use them for other stuff but they wouldn’t have nearly as many if the job was just passing out food.