Nukes are so incredibly inefficient, they're damage per metal is very low compared to an equal metals worth of a unit army. Not to mention you can make much, much more anti-nukes than they can nukes.
There isn't a mutually exclusive relationship between the enemy having nukes and your chance of victory, both are possible and can occur at the same time.
When a player is so much better at you at the task of building his economy, chances are he's that much better in army management and everything else. Thus, you lose....
And the price for the most pointless keeping a thread alive goes to you. If the enemy can OVERWHELM you with nukes he can overwhelm you ANY other way. The nukes are not the problem. That you are so far behind in ECO, Fabricator and scouting game is. Those are problems you can only fix yourself. If he can overwhelm you with nuke spam, he could overwhelm you with vehicle spam or bot spam or any other spam* *excluding the artificial/unwatned difficulties or orbital invasions/asuming an already existing teleport connection.
Like few people stated above, he/she nuked you because it takes less work/clicks for player. It is maybe not eco effective (and who cares when you have more metal than you can use), but it is much less click spam than invasion. Also 1 nuke slows late game much less than 500tanks. Nukes are not imbalanced, you lost long before those nukes came.