Keep in mind that most employeers don't do their own payroll anymore. With all the laws and records requirements and reporting surrounding payroll these days, it's just become way to complicated. Add in a few employees with child support payments, garnishments, etc., and it gets very tricky very fast. Doing payroll has become a bit of a special expertise. Employeers with less than about 250 employees generally find it easier and cheaper to contract payroll processing out. This is why one in six employees in America is paid by ADP, the leading payroll processing firm in America.
But, payroll processing firms don't work for free. They charge the employeer for every piece of paper produced and every service performed.
So, when you request a duplicate W2, ADP will charge your former employeer for producing that. (They charged your employeer for producing the first one, by the way, but, because it's outside of the normal process flow, producing the duplicate will cost more.)
Years ago, I worked for a firm that went bankrupt. Some people wondered if we'd even get W2s. But, the W2s did come. ADP sent them. The processing of one W2 per employee had already been paid for as part of the payroll processing fees the company had been paying ADP all along. One person, however, lost his and getting a duplicate from ADP was difficult (since he wasn't the person authorized in ADP's files to sign such requests) and cost something like $20.
Chances are that even at $5, your former employeer is still subsidizing this for you.