Why do I tab out of Minecraft when I click something on the second monitor?
Because you're in full screen mode.
Switch to windowed fullscreen if that is possible.
As long as you are not using Minecraft in windowed mode, it is the normal behavior of full screen games.
Unfortunately it does not work
https://www.google.ch/search?q=minecraft+windowed+fullscreen&source=hp&ei=fPl2YI36NPyJjLsPw9CLoAU&oq=minecraft+windowed&gs_lcp=ChFtb2JpbGUtZ3dzLXdpei1ocBABGAEyBQguEJMCMgIIADICCAAyAggAMgYIABAWEB4yBggAEBYQHjIGCAAQFhAeMgYIABAWEB46CAgAELEDEIMBOgUIABCxAzoLCC4QsQMQxwEQowI6CAguEMcBEKMCOg4ILhCxAxDHARCjAhCTAjoCCC46CwguELEDEMcBEK8BOggILhCxAxCTAjoFCC4QsQM6CAguELEDEIMBOggILhDHARCvAToLCC4QsQMQgwEQkwI6BQghEKABUK8LWNUlYIwvaAFwAHgAgAGvAYgBxxGSAQQxLjE4mAEAoAEBsAEA&sclient=mobile-gws-wiz-hp
Google says otherwise.
This is completely normal and is the case with EVERY game.
Just play in window mode, then you can tap around as you want
Google doesn't say anything else. Minecraft can't be switched to windowed fullscreen without any modifications