To the OP:
There is a BUG in DNN5 (which I reported and provided a solution for, which was promptly ignored) where the SQL statement that triggers when you Assign/Unassign Premium modules was impacting ALL modules/sites.
The Stored Procedure, DeletePortalDesktopModules has errors in the 2nd and 3rd IF statements.
The IF statements in that procedure SHOULD be:
IF @PortalID is not null AND @DesktopModuleId is not null
DELETE FROM dbo.PortalDesktopModules WHERE PortalId = @PortalID AND DesktopModuleId = @DesktopModuleId
IF @PortalID is not null AND @DesktopModuleId is null
DELETE FROM dbo.PortalDesktopModules WHERE PortalId = @PortalID
IF @DesktopModuleId is not null AND @PortalID is null
DELETE FROM dbo.PortalDesktopModules WHERE DesktopModuleId = @DesktopModuleId
The @DesktopModuleId is null was left out of the 2nd statement and the @PortalID is null was left out of the 3rd statement. So, when the first condition was met, the 2nd and 3rd were ALSO met.