In general, yes. Or, to be more correct, he was not 'wrong.' That is, he broke no rules.

There are circumstances where various codes require dedicated circuits, or limit the number of receptacles on a circuit, but these rules probably don't apply to the receptacle you describe.

This brings up the next question: Was simply extending the circuit the wise thing to do? The answer to that has a lot to do with what the electrician knew about the intended use of the receptacle.
For example, if this was to add a receptacle to a mud room, so that you could plug in a space heater .... it would have been wiser to run a new circuit from the panel.
If the intent was to have the bedside table served by a receptacle that wasn't buried behind the bed, extending the existing circuit made wonderful sense.