Part of it might be that consumers want smart TVs, but it's definitely the case that consumers are very price-sensitive when it comes to TVs, and that selling ad space (and selling/leveraging data gained by stalking your users—why this shit is legal is beyond me) on an integrated OS lets you sell at, or even under, the cost to deliver the hardware, and remain profitable.
This is also why it's really, really hard to build a Roku competitor starting from 0, without a lot of starting capital. You won't be able to match them on price, and also won't yet have the scale to subsidize your own devices with ad sales, so you'll need to sell at a loss (remember: you also need to get onto shelves in stores to compete, and they'll have harsh price requirements, calibrated by what your ad- and spyware-subsidized competitors are selling for, if you want shelf-space with an unknown brand) for quite a while.
This is also why it's really, really hard to build a Roku competitor starting from 0, without a lot of starting capital. You won't be able to match them on price, and also won't yet have the scale to subsidize your own devices with ad sales, so you'll need to sell at a loss (remember: you also need to get onto shelves in stores to compete, and they'll have harsh price requirements, calibrated by what your ad- and spyware-subsidized competitors are selling for, if you want shelf-space with an unknown brand) for quite a while.