I worked at Sun from 1995 to 2004. My take is that Sun had major structural problems all along, but as long as money streamed in from the tech bubble, these issues could be ignored. When the tech bubble ended, it was too late to fix the problems.
One big problem was that there was no cooperation inside Sun. Groups in Sun kind of viewed HP as a competitor, kind of viewed SGI as a competitor, but the real competitor to be destroyed was that other group in Sun. The leaders of the project I worked on spent most of their time in political battles, trying to acquire or outmaneuver the other teams working on similar projects.
Another problem was that the main parts of Sun had conflicting strategies. The Solaris/SunSoft division wanted to run on SPARC, x86, and Power PC for the largest market. The SPARC division, of course, wanted none of that. The hardware division wanted to make expensive servers, but the other teams saw cheaper hardware as the right direction. The market ended up moving to cheap rack-mounted Linux x86 servers, so nobody at Sun won in the end.
Right before they fell face-first into the grave, they did finally ship the v20z, which was a completely reasonable way to run Solaris x86. Its management board ran Linux on PowerPC, for irony purposes.