We would like to hide the desktop sync for all SharePoint sites by default and give users the opportunity to only enable this for required document libraries in a ShatePoint site. Are there UI settings to hide this for all SharePoint sites while having this turned on for OneDrive ?
If you mean to hide the sync option in document libraries, this is something you can configure on per-document library: Settings -> Document Library Settings -> Advanced Settings -> Allow items from this document library to be downloaded to offline clients? -> No
You could automate this setting using some PowerShell
This setting can be configured at site level as well. This means that we would need to write a power shell script that disables this for all SP sites and configure a job that does this for all newly created sites.