This is intentional as per:
Should we create a new site setting to control this behaviour or just make login modal show consistently for normal and “login required” sites alike?