Sometimes being able to see what they can’t do can help advertise the feature to them. For example, if they would be able to do it if they joined a group or paid a subscription or used the platform more so they had a higher trust level, then showing a disabled button (or link or whatnot) can help them become aware the feature exists.
But I agree that it’s not always helpful to show such things.