According to the Linux Standard BAse:
The system User IDs from 0 to 99 should be statically allocated by the system, and shall not be created by applications.
The system User IDs from 100 to 499 should be reserved for dynamic allocation by system administrators and post install scripts using useradd.
So, regular users should have UIDs > 499. Furthermore, the Debian Policy states that:
Globally allocated by the Debian project, the same on every Debian system. These ids will appear in the passwd and group files of all Debian systems, new ids in this range being added automatically as the base-passwd package is updated.
Packages which need a single statically allocated uid or gid should use one of these; their maintainers should ask the base-passwd maintainer for ids.
Dynamically allocated system users and groups. Packages which need a user or group, but can have this user or group allocated dynamically and differently on each system, should use adduser --system to create the group and/or user. adduser will check for the existence of the user or group, and if necessary choose an unused id based on the ranges specified in adduser.conf.
Dynamically allocated user accounts. By default adduser will choose UIDs and GIDs for user accounts in this range, though adduser.conf may be used to modify this behavior.
This also applies to Ubuntu since it is based on Debian. I haven't found an explicit mention of this but, in general, system users are not allowed to log in graphically and, often, not allowed to log in at all. Therefore, the reason why your user couldn't log in was that you had chosen a UID that was too low.
Additionally, in the Debian world, it is recommended to use
adduser and not
useradd when creating accounts. From
useradd is a low level utility for adding users. On Debian,
administrators should usually use adduser(8) instead.
All this is to say that i) you should have used a UID >=1000 and ii) just use
adduser and accept the defaults and everything will be set up as you expect it.