Why doesn't sed pattern matching treat '\t' as a  character?
BSD sed follows the POSIX standard for BRE's, see man 7 re_format. In particular the following:

                                             all other special charac-
 ters, including `\', lose their special significance within a bracket
 expression.


Nor is \t treated special (as the tab character) in the pattern.

You have the following options:

# Type a literal tab in the /pattern/ with the keys &lt;control&gt;&lt;v&gt;&lt;tab&gt;
's/&lt;control&gt;&lt;v&gt;&lt;tab&gt;/    /g'

# Use a character class within the bracket expression
's/[[:cntrl:]]/    /g'

# Use ansi -c quoting
$'s/\t/    /g'

# Print the tab with printf
"s/$(printf '\t')/    /g"