Yes, and no.
Yes, it's not the most optimal business decision as a software company to invest in hardware. The clear move is to either grease Microsoft's palms, or let then outright acquire Steam (or Valve as a whole). Valve not doing that is either in part ideological, or part very long term thinking on the best financial path later, instead of now.
But at the same time: while the ends was "be independent from Microsoft", their means at first was very Microsoft esque. Partner up with hardware vendors, make some Pcs with Steam built in, and brand it as such. Didn't work. Their goal had to be to roll their own hardware because that's what was needed to get the ball rolling (as well as a form factor that accompanied a desktop instead of competed against).