Well, I think it was a combination of things, and Linux was certainly a part of the reason. But not the whole reason. There are several reasons why Sun finally died:
(1) Sun hardware just couldn't keep up with Intel. The many-threads model really only worked well for parallelization of database operations and not much else. Each individual cpu thread simply became too slow. And people stopped caring about database benchmarks because they were more a function of rapidly improving storage and networking technology than anything else. CPU performance stopped mattering so much and Sun's super-optimized core hardware advantage went right out the door along with it.
(2) Sun's utility software quickly fell behind linux and the BSDs. I began noticing this long before Sun actually sold out to Oracle. Sun's kernel stayed fairly relevant, Solaris wasn't bad... very solid in fact. But competing operating systems were also becoming more solid. But, OMG, the utililties were all 80s crap. Nobody growing up in today's world (or even the world of a decade ago) would be happy with a base Solaris install.
(3) Sun basically became like IBM... corporate only sales and screw making anything that could be bought by up-and-coming students. Solaris for x86 was never taken seriously by Sun, and thus never taken seriously by people outside of Sun. With students growing up on Linux (the younger age group) and the BSDs (my age group), Sun started losing market power as these generational shifts began moving into the workplace. Also, system needs by the web began changing. Sure there are still huge backend databases, but most of the services (and the related hardware) were becoming heavily distributed and Sun's hardware just didn't fit the model.
In fact, this is similar to the problems that SGI had. They were married to their hardware (don't get me started on Solaris for x86), the hardware became non-competitive and unpurchasable by smaller businesses or individuals, and the base software was locked into an 80's snapshot of hell. The system programmers lost sight of what people wanted and got tunnel vision, super-optimizing database paths and ignoring everything else. Problem is, people were more interested in the 'everything else' part.
It might be fine for the older IT types, but all the newcomers had grown up on Linux and the middle-agers had grown up on the BSDs. Their rotation into the workplace spelled Sun's death in very loud, clear terms that Sun pretty much ignored.