A federal judge ruled Tuesday that New York’s expanded ban on assault weapons and high-capacity magazines was constitutional, but he struck down a provision forbidding gun owners from loading their firearms with more than seven rounds, which he called “an arbitrary restriction” that violates the Second Amendment.