If there is a valid security concern, it would be about multiple pax congregating at the F lav, near the cockpit door (747's obviously excepted). There's several dozen reasons why such a congregation would be unlikely to "successfully" take over the plane, but it could be the first visible sign of such an attempt.
When an airline (and the "rule" is not limited to just UA) insists that pax use the lav in the ticketed cabin, it makes such congregations and the resulting concern less likely.
I've heard it phrased as a TSA requirement.

(Would give them something to oversee when the coming midflight ID check is rolled out

/sarcasm)
A FAR? pshaw. Some airline employees long ago concluded that all pax are fools and will do exactly what employees say if they cloak the requirement as a FAR.