Question:
Consider the scenario where in a society of many thousands (or millions), one in a hundred individuals engage in activity X on their property that goes undiscovered. Let's assume that activity X, on occasion leads to event Y, which hurts people.
Let's continue to assume that activity X continues to go undiscovered almost all the time.
Now, let's assume that there are ways to limit the amount of activity X through regulation or laws, without actually violating a person's privacy - i.e search and seizure. What is your opinion on this matter?
It's really hard to give an answer without specifics. The key issues are the mechanism by which it hurts people, the amount of harm it does, and whether the activity is within the scope of the moral authority of the people who engage in it.
How do the victims who have no next of kin receive restitution?
That depends on the mechanism of harm. Hypothetically, if the action is something like making a chemical on your own property that can blow up and hurt/kill your neighbors, then they can sue for the damages. Society could require insurance as a pre-condition to engaging in behavior that poses risk to others.
Would it not be better to try and prevent Y type events?
There's no way to know. The information necessary to make this judgment generally doesn't exist.
What if most of society deems activity X to be unnecessary?
Then most of society will refrain from activity X and minimize the harm done. Presumably, those who do it deem its benefits to exceed its harms. The key thing is to make sure their calculation includes all the harms.