Is there a way to bind TAB so that it outputs 2 space characters? I know you can do this in a text editor like Vim, but I wanted to carry over this functionality to
Not at the xmodmap level. You could make a program grab the key and inject two spaces into the focused window. Or you could configure your terminal emulator to do the transformation. For example, in xterm, you'd do it with a resource setting:
However, I definitely recommend against this. You'd lose the ability to use Tab for anything else, such as completion in shells and other text mode programs.