Ehh, not always. It is often best to avoid a full OS in favor of something with less complexity. Android Things and Windows 10 IoT are attractive for this reason, among others.
Given that you mention it, from a hobby developer perspective, I would rather pick W10 IoT, because at least Microsoft does offer proper support for C++, including easy integration with .NET, unlike the dev experience with the NDK.