Yes, an Accent is rated to be roomy for a subcompact. But overlapping into compact category doesn't gain the Accent much, because that's a relatively small market compared to the mid size sedan market that the Elantra is reaching into. That extra 4" width would determine whether you could fit an extra passenger or child seat in the back seat, and every bit of trunk space counts. So while an Accent might feel like a compact inside and on the road, the Elantra is bigger still and feels, sounds and drives like a mid size inside and on the road. Also, for people looking for more luxury, the Elantra has more goodies like heated front and back seats, leather seats, backup camera and a navigation system. I guess with today's low interest financing people are willing to buy more car.
I would be perfectly happy with an Accent as my daily commuter, and until this month was driving a 2001 Accent. But in looking for a family hauler I had other criteria that the Elantra filled wonderfully and at significantly less money than a mid size sedan. It depends on your needs, and I guess the Elantra fills more people's needs than the Accent.