That's known issue in Magento2.1.x
this issue is solved now magento2.2
you can check here for more detail
https://github.com/magento/magento2/issues/7298
for quick hack you can do following
Create a prefrence of this class vendor/magento/module-url-rewrite/Model/Storage/DbStorage.php
and rewrite doReplace()
this method
protected function doReplace($urls)
{
foreach ($this->createFilterDataBasedOnUrls($urls) as $type => $urlData) {
$urlData[UrlRewrite::ENTITY_TYPE] = $type;
$this->deleteByData($urlData);
}
$data = [];
foreach ($urls as $url) {
$data[] = $url->toArray();
}
/* Add this line : Get rid of rewrite for root Magento category to unduplicate things*/
foreach($data as $key =>$info){
if(isset($info['target_path']) && stristr($info['target_path'],'/category/1') && $info['entity_type']=='product'){
unset($data[$key]);
}
}
$this->insertMultiple($data);
}