Yes, Linux was started for free as a student project, but the reason why it became the standard choice for data centers is because large corporations like Oracle, IBM and later Google united behind it in order to stop Microsoft from dominating servers. These corporations along with some commercial distributions have been funding Linux development for decades. Linux as we know it today is a child of corporate strategic thinking.
IBM, DEC, Sun, HP and others already had commercial Unix offerings with support that corporate users wanted for servers. Why unite behind Linux, which at the time was inferior to all those others?
To attack Windows from the top and bottom simultaneously. It may seem excessive but MS was in a very strong position at the time. Many of us wondered if anything else would survive.