I commute on a hardtail - but my commute is rock,mud and sand - rarely do I touch pavement. If your surface is pavement, no reason why a road bike won't be the right thing - if your commute is more than 10 miles, it might be the best thing.
Under 5 miles, almost anything goes.