A node is allocated to a user when a service is deployed to the node with juju. To return the node back to 'Ready' state you need to remove the service from the node with juju and terminate the machine.
To remove the service from a machine check 'juju status' to determine machine-id corresponding to your machine. Then under services see which service is deployed to the particular machine-id.
To remove the service use either 'juju remove-unit service/X' if removing a single unit or 'juju destroy-service service' if you want to remove all remaining units.
juju remove-unit ubuntu/3
The machine can then be terminated with 'juju terminate-machine machine-id'
juju terminate-machine 23
Once the node is in the 'Ready' state it can be deleted from MAAS.