The Frightened condition (PHB, pg.290) states:
It says nothing about the creature having to immediately leave the area or being unable to attack you so your DM was correct.
If a spell or ability requires the Frightened creature to run away from you or makes it unable to attack you it is specifically stated such as in the Fear spell:
While frightened by this spell, a creature must take the Dash action and move away from you by the safest available route on each of its turns, unless there is nowhere to move.
or a clerics Channel Divinity: Turn Undead feature:
A turned creature must spend its turns trying to move as far away from you as it can, and it can't willingly move to a space within 30 feet of you. It also can't take reactions. For its action, it can use only the Dash action or try to escape from an effect that prevents it from moving. If there's nowhere to move, the creature can use the Dodge action.