Follow the given steps to disable the right click functionality on desktop:
To use this feature, you will need to be logged into your computer with administrative rights.
Click Start button and type regedit in Run option then press Enter for next.
Here locate the location to:
HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesExplorer

Here in right side panel, right click to create a new DWORD value with the name NoViewContextMenu (it is case sensitive), then assign number 1 in value data box.

Now close the registry editor and restart your computer after any changes to go into effect.
But next time, if you want to enable right click functionality on desktop then simply change the value of data box or delete the NoViewContextMenu DWORD item.