If I have TF2 open on one monitor if I click on any other tab in the second monitor it minimizes the game.
Is there any way I can fix this?
You can switch windows without minimizing by using Borderless windowed mode.
This can be done in a couple ways, the easiest is by going into your "Options> Video" settings in game and setting the game to "Run in a Window".
Alternatively you can modify your launch settings by adding the launch options
-windowed -noborder in the TF2s "Properties > General" settings directly in Steam.
I believe the setting you're looking for is borderless windowed mode in team fortress 2. As the name suggests, it puts the game in windowed mode but removes the border, so it should still appear as full screen. That should fix your issue and allow you to click without minimizing!
I addition to the in-game option mentioned in the main answer, you can use Steam Launch options - I use these for Counter Strike and they work for TF2 as well.
-window -noborder -novid -nojoy -w 2560 -h 1080