I don't see anything in the rules that specifically prevent you from making one or more primary attacks with a weapon wielded with two hands and attacking with spiked gauntlets as an off hand attack, but there are certainly some reasons why your DM may not allow it.
It's not how monsters work
If you look at the werewolf lord, when in hybrid form, the monster has two primary claw attacks and a secondary bite and there's a bastard sword as well under the attack listing. Under the full attack action, we see when the werewolf lord is using a bastard sword, only the bite attack is listed as a secondary attack. The mechanic here is combining natural weapons with manufactured weapons, not two-weapon fighting, but why doesn't the werewolf lord gain a secondary claw attack when using a bastard sword, since he doesn't need to hold the weapon in two hands when not attacking with it? The same is true of the bearded devil, horned devil and ice devil. Tacitly, each listing is implying the rule; you can't gain a secondary attack while using that limb for a mechanical weapon. Making an attack with a spiked gauntlet after using that limb to make an attack with a two-handed sword would seem to violate this implied rule. Each of these monster listings has the Strength bonus to damage listed as 1.5. Which leads to the next point.
It's the equivalent of x2 Strength bonus
When fighting with two weapons, the primary hand gains x1 Strength bonus to damage and the off hand gains x0.5. When wielding a weapon with two hands, you gain x1.5 Strength bonus to damage. Allowing an off hand weapon with a two handed weapon grants x2 Strength bonus (total). Nothing in the rules cap the Strength bonus, but the DM may. Alternatively, the DM could allow it, but treat the two-handed weapon as the "primary hand", only gaining x1 Strength bonus.
Extra shield benefit
The same sort of over benefit occurs if you fight with a one handed weapon and shield, and make an off hand attack with armor spikes. You are now benefitting from the shield bonus and the off hand attack. If the attack had been made with the shield, retaining the bonus would require Improved Shield Bash. Perhaps again, even though legally acceptable, the DM may choose otherwise, or may allow the two weapon fighter to benefit from the shield with the feat, even though the off hand attack isn't coming from the shield.
Outside of two-weapon fighting, these considerations aren't important.