At the time, major "web development" stacks that people would have thought of on Linux tended to be much more resource hungry (still are), meanwhile the people behind StackOverflow had very good .NET skills that they could apply immediately. This translated into being able to serve more people per server than if they used, let's say, PHP, Ruby, Python, etc.
And as people said, SQL Server. Which is a very, very capable database server with impressive performance.