The permissions on /etc/paths.d only allow the root account to write to it, not normal admins. This is actually fairly common in OS X, since many users operate day-to-day as admins, but for security reasons it's a bad idea for them to have write access to any settings that can influence system integrity without going through an explicit I-mean-to-do-that step.
So how can you add a file? In general, you need to use a process that promotes to root to do the operation. I'll give three examples:
- Create the file someplace else, then use the Finder to move it into place. Since /etc is normally invisible, in the Finder, you'll need to explicitly open it by choosing Go > Go to Folder from the menu, then entering "/etc/paths.d". Then just drag the file into that window, and it'll ask for your admin password (which it uses to promote to root and move the file).
- Use TextWrangler or its big brother, BBEdit (the download version, not the Mac App Store version). They have built-in capability to safe files as root (after entering your admin password, just like Finder). If you're going to be manipulating system config files on a regular basis, this is (IMHO) the easiest option.
- At the command line, you can use
sudo
as a prefix to run a command as root (again, after entering your admin password), e.g. sudo cp mypathfile /etc/paths.d
or sudo vi /etc/paths.d/mypathfile
.