It's not 'free' at all. It is a really interesting trade-off.....yes you can trade that tech, but is it worth the advantage you give the other player? Sometimes yes, sometimes no. It was a choice with countless permutations and game-specific variables.
That doesn't matter, you continue to generate value from something for yourself, while you split value among other players. You always win more than every other player you trade with.
Realistically you as a player don't even have that "choice" anyway. For practical purposes you HAVE to tech-trade, because if you don't, then everybody else tech-trades (and does so semi-competently) and you're the only one left behind.
The important thing is that you don't "give anything away", you duplicate. Therefor your supply is unlimited (technically it's of course limited by the amount of Civs that you can trade with).
That's especially true when you're the first one to get a tech. You can then trade it in with every single other player, yes, they all get that tech, but you get value equal to that tech x the number of players available (and value that is actual value, not "infinite" value as technologies are).
It just can't be balanced.
/edit:
Imagine you could build an improvement on silver and then trade that silver with every other player on the map while still having silver for yourself.
And then imagine if everybody just traded all their luxury goods with each other without ever losing their own sources. That's what tech trading is.
In Civ 5 there is never any reason to NOT enter a research agreement, unless you're about to declare war on them (which you're unlikely to do, since war has no purpose in Civ 5).
Well, Research Agreements cost Gold for both players, that's a reason. Mechanically it's "Trade Gold and the risk that a war may break the agreement before it's finished for science".
The Gold Cost wasn't high enough to discourage spamming research agreements throughout most of the lifespan of the game, that's certainly true, but research agreements are not free.