Frist off let's me say I absolutely love both BG1, BG2 and Icewind Dale. Vanilla BG1 is rather bland and the game requires some modding to be loveable, though.
I think Icewind Dale is more even in quality, but it's also more limited in scope than the BG games.
The BG games are obviously more ambitious and have more strings to play on, with more diverse environs.
The Icewind Dales are about dungeon crawling and that's about it, while the BG games also (try) to have a more engaging story and party members that are not just a bunch of numbers. Mostly I think the BG games succeed. The annoying romances can easily be avoided, there are more fun than annoying companions, and the banter and interjections add fun to the game. But all the dream sequences and psycho babbel involving Irenicus and Imoen gets tiring, and as others have pointed out your motivation in BG2 supposes you actually like Imoen. I liked her in BG1, but in BG2 I find her exceedingly annoying, so my party has exhausted all alternatives when they grudgingly set out to rescue her.
The writing in Icewind Dale may be more mature and objectively better, but the BG games still have all the memorable quotes.
The BG games are more nonlinear than IWD, especially on the strategic level. But also the inidividual maps in the BG games tend to be more open. And despite being very linear IWD has some balancing issues, with for example the Burial Isle being very difficult and then the next area is far too easy with Trolls and other relatively weak enemies.
When it comes to combat and encounter design, the BG games easily reach far higher heights than IWD. Sure, there are lots of trash mobs in BG1, but they can usually be avoided if you scout the area. The BG games are unsupassed when it comes to good encounter design. In which other games do you fight against multiple enemy parties? Which other games have mage duels like BG2? Which other games make Liches and Dragons so dangerous and detailed as in BG2? In the Gold Box games you usually roflstomped liches and armies of dragons, in BG 2 even one of them are deadly to a high level party.
Where IWD shines is in the large battles where you face armies of Undead, and shadowed Elfs and Orcs. BG battles are usually smaller, but often with more resourceful enemies.
What's good about all the IE games is that enemy AI can actually be modded, and we get mods like the brilliant Sword Coast Strategems that turn a mediocre BG1 into one of my absolute favourite games.
One thing I think IWD does better is loot randomization.
But they are all great games.