You can totally save them both. Maybe not on your particular playthrough, but they can both be saved.
Of course not being able to save them both is better story-telling and would back up the catalyst's claim that creators and created cannot coexist, not to mention that it is so much more heart wrenching.
But yeah, in the renegade playthrough I didn't have tali and legion was killed. I hated my renegade Shepard after that, I wanted him dead by then.
Truly one if the most tear jerker moments
KeenBlade wrote...
When it came down to it, choosing between the Quarians, and the Geth, which took me almost 10 minutes of alt-tabbing, searching and wrestling my morals before I finally realized there was no way to save both peacefully regardless of setting everything up right in ME1 and ME2... I had romanced Tali, and wanted to continue the romance. I love everything about Tali, but She was with me on Noveria when I freed the Rachni saying that I wouldn't be responsible for the total genocide of a race. I told Legion to upload the reaper upgrades. Tali called the warmonger admiral and begged him not to attack. He blew her off (really wish I let Raan pull the scout fleet away at that point), which caused Tali to beg Legion not to complete the transmission. I chose to stop Legion.
The following scene tore me up so much since Legion and Tali were 2 of my teammates tied for first along with Thane, Mordin, Grunt (who almost died in mine), and Jack.