To be taxed with Mary his espoused wife
Whom also he had married, though he had not known her in a carnal way; she came along with him to be taxed and enrolled also, because she was of the same family of David, and belonged to the same city:
being great with child;
very near her time, and yet, though in such circumstances, was obliged by this edict, to come to Bethlehem; and the providence in it was, that she might give birth there, and so the prophecy in ( Micah 5:2 ) have its accomplishment: this was an instance, and an example, of obedience to civil magistrates.