In the screenshot you show the mouse settings for the default profile. Does GalCiv3 run under this profile or does it have its own?
LGS sometimes gets confused and links the wrong executables to profiles, so you might have to check all of them. Point at a profile, click on the little down pointing arrow (in the lower right corner of the Profile icon), and select "Properties". Check if the GalCiv.exe is linked in only one profile. Check the mouse settings in the profile that handles the GalCiv.exe.
Sometimes background tasks can make LGS switch profiles, even while the game is running. If so tick the "Lock profile while game is running" in the profile properties.
Check if there is no script attached to the profile that you are using for GalCiv3. Point at a profile, click on the little down pointing arrow, and select "Scripting". A empty script should look like this:
function OnEvent(event, arg)
--OutputLogMessage("event = %s, arg = %s\n", event, arg);
Furthermore make sure you do not have a profile that activates on the steam executable.
Piece of advise: If you don't have a separate profile for GalCiv3, make one.
Also, does the middle mouse button function in other programs?