You can in fact buy a minimal edition of Windows from Microsoft, e.g. Windows 10 LTSC. However, to buy it legally one needs to jump through some hoops (I think you need to have an Azure or enterprise account, or something) before being able to buy a license.