Why is it that I cannot open file in terminal when in root?

I believe you're using su or similar to login to the root account while in your normal account. While you are using Terminal, any action taken in the Terminal.app will have the same root user level access.

However, once you leave the Terminal.app, such as when you use the open command, that opened app does not inherit the special permissions from root. It sends you back to normal land where your user account is limited.

To workaround this, you can use a text editor available in root. A short list includes vi, vim, nano, emacs, pico. I'm a fan of nano as it shows most of its commands in the window. You can use the following command in your normal user to edit a file like so:

sudo nano /some/file.txt

The command to save (write out) is control+x (^O), and quit (exit) is control+x (^X). Good luck!