Its because using the VS web server, .NET handles requests for all files including .html .css etc, but in IIS this is not the case, so those kind of files can't be secured by .NET on IIS without special configuration of IIS, because by default IIS handles those requests directly and .NET is not involved. In IIS 6 you would need a special isapi handler, in IIS 7 it may be easier with some of the new modules they have.
Hope it helps,
Joe