I have a bluetooth keyboard cover for my ipad - I can type the PIN using the keyboard, no need to touch the screen - it's actually very convenient.
In which case you could still either manually do it (should take no more than a day), or create quite easily a lego-mindstorm or similar device to click on all the combinations "on the screen".
Probably for compatibility with peripheral devices.
Including accessibility for blind users, I assume. Touchscreens are not great input devices if you can't see what's on them or whether you got your finger on the right button.
Accessibility.
It's so iTunes can unlock the device.
iTunes unlock is actually done with a pre shared key during sync.