This question is already answered somewhere on this site, though I failed to find it.
But basically it comes down to this:
sudo nano /etc/network/interfaces starts nano /etc/network/interfaces as uid 0. Since nano runs at uid 0 and has permission to write to /etc/network/interfaces.
sudo echo something > /etc/network/interfaces starts echo something as uid 0. That part succeeds. The output is redirected with the > to /etc/network/interfaces`. However this redirect is done with your own account. And that one has no permission to write to that location.
Try this instead:
sudo bash -c "echo something > /etc/network/interfaces"
That should run bash as uid 0, and let bash execute a the whole command as uid 0.
Or simply su - to root. Running all the time as root is not recommended, however there are times when you simply want to have sufficient rights without typing a sudo-command in front of every single line. Just do not use root as main user. Using it to install and configure a system is fine.