The most defensible thing you can say about this is that the cost is primarily borne by the shareholders rather than the consumers. Thus you tend to see that the best unions for workers tend to be in large, established, highly profitable firms with little to no competition. A prime example are the American automakers before the 1980s when foreign competition kicked in. Working on the GM assembly line in 1970 was a very good job.
However Amazon is barely profitable as it currently stands. Since there's essentially no room for lower profitability. The only give is either higher consumer prices or deadweight loss, i.e. fewer customer and therefore fewer (but higher-paid) employees. That might not necessarily be a bad thing, especially to the extent that the average Amazon customer is wealthier than the average Amazon warehouse worker. But given Amazon's extremely thin profit margins, I don't really see anyway that consumers won't end up paying for the sizable bulk of the unionization costs.
[1] https://journals.sagepub.com/doi/abs/10.1177/001979399204600...