Thanks for posting your question in the Microsoft Q&A forum.
In your SharePoint site, go to the "Site Permissions" settings. Under the "Share" section, select the option to "Only site owners can share files, folders, and the site". This will ensure that only the site owners and the Azure AD application (with the necessary permissions) can share files and folders.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful