The companies are doing it to decrease liability on some accounting spreadsheets.
If you really care about staff you improve work life balance, pay competitive rates, spot and remove dumb managers and assholes.
Sorry but 2 weekss mandatory vacation is not going to help much, on the contrary it might make someone angry when forced to take time off when the company is slow, not when a poor dev wants to actually go somewhere for holidays.