Bad influences come in many forms, and remedies aren't always laws.
Sure, a law won't automagically fix everything. But it provides the starting point that almost every individual or group action must rely on.
(Then of course the trick is that older kids will show porn to younger ones just to mess with them. Of course ID requirements won't fix this.)