Why does SendGuard warn me only when I attach a file and not when I send an external email without one?

This is probably due to your SendConfirm settings to show prompt for is set to External Recipients AND Attachments. You will need to change this to External Recipients Only and you can do this by following the necessary steps below:

Step 1: Log in to the SendGuard Management Console
Step 2: Click on M365 settings 
Step 3: Under SendConfirm settings, if Show prompt for is set on External Recipients AND attachments, change this to External Recipients Only. 

Step 4: Then click Save.