So if those 5000 people are doing work that is not valuable, we should keep paying them to do worthless work? There are a million worthwhile things we need people for, let's not pay them for busy work.
This is why we need a good social safety net... those people should be let go, and find new productive work... but as you pointed out, that will be extremely disruptive to their lives while they find new work. If we could support them with a safety during that time, to prevent this business decision from depriving them of their livelihood while they found a new place where their labor was productive, we could be both economically and morally efficient.