Why can't this application be deactivated after screen is locked?
WhatsApp employs a mechanism that ensures messages are always notified (as long as data connectivity is present) , which is well explained here How is WhatsApp able to receive messages when not in use?. That's the reason on your device, the red warning is displayed

You can instead Greenify WhatsApp . For details  see greenify questions like How does hibernating an app work technically? and XDA - Greenify

Edit Protected apps feature may be used. I am not sure if this feature exists in the emui version you have. What is protected apps in Huawei phones?