The POSIX standard says:
"Filenames beginning with a ( '.' ) and any associated information shall not be written out unless explicitly referenced, the -A or -a option is supplied, or an implementation-defined condition causes them to be written."
Being root is evidently not considered a condition which causes hidden files to be written by the GNU Coreutils implementation of
ls that is commonly packaged in Linux distros.
There are good reasons not to have the behavior of programs influenced by global variables, like which user ID is in effect. A script developed as non-root will change behavior when run as root.
The hiding of files that begin with dot is not a security mechanism; it shouldn't be connected to security contexts. It conceals things that we normally don't want to see, like the
.git directory among your
.c source files or whatever. If you have read access to another user's directory, you can list their hidden files. The dot hides items whose presence is expected and uninteresting, not whose presence is intended to be secret.
Dotted directory entries other than
. have no special operating system status; just
ls treats them specially.
I just tried Solaris 10; its
ls also has no such behavior. It is not a universal "Unixism", which explains why the POSIX requirement is worded that way.