Yes it's 'legal' because you agreed to it!
It's also very sensible. It's a precaution against new sellers cutting and running with the money and leaving PayPal to meet the cost of the buyer protection claims!
When I started selling on eBay over ten years ago sellers had to earn the right to having buyer protection. You had to complete 50 sales with about 95% good feedback before you qualified. It was the sign of a proven good seller and I can remember being proud when I reached it!
Today new seller's auctions are covered by buyer protection from day one - hardly anyone would buy from them without it. So having to wait for payment until the buyer tells PayPal that their items have actually been delivered is a small price to pay!