A 2006 law designed to boost employees' retirement-savings is having the opposite effect for some people.

Under the law, companies are allowed to automatically enroll workers in their 401(k) plans, rather than require employees to sign up on their own. The measure was intended to encourage more people to bulk up their retirement nest eggs—a key goal in a country where millions of people aren't saving enough.

But...