macOS doesn’t let you outright disable that button through System Settings, since it’s treated as a system-level shortcut (similar to Control–Command–Q). That’s why every time you tap it, the screen locks immediately and forces you to enter your password or Touch ID.
There are a few workarounds though.
- The simplest is to adjust System Settings → Lock Screen and change the “Require password after screen saver or sleep begins” option to something more forgiving, like 5 minutes instead of “immediately.” That way, if you accidentally bump the key, you won’t have to re-enter your password unless enough time has passed.
- Alternately, If you really want to block it, the only potentially reliable way is with a third-party key remapping utility ... something like Karabiner-Elements. With that, you can remap or disable the Lock key entirely, so pressing it won’t trigger anything.