Can someone enlighten me of why the /etc/environment is ignored on Raspbian?
It isn't. Add this to
echo $FOO. It's there.
/etc/environment isn't actually sourced by the shell, it's used by the authentication system (PAM) to set an environment before your login shell is executed. The idea here is to allow for setting env variables in a shell agnostic way -- while bash and other POSIX shells will source stuff like
.profile, other shells may not. However, the environment is actually part of, and inherited by, all processes (not just shells), so by setting it before any shell is executed, PAM guarantees those variables will be set.
Of course, they can then be overridden and presumably this is what is happening with
$PATH. If you are using bash, it is probably more hassle than it is worth to figure out what by, but very likely it is
/etc/profile, since on Raspbian that contains:
if [ "`id -u`" -eq 0 ]; then
Rather than edit this, the method you're using -- adding your own file to
/etc/profile.d -- is preferable. It guarantees your changes will not be overridden by system updates.