A martial with spells isn't a spellcaster who can use a weapon.
It's a martial with spells.
They're meant to focus on the supporty, buffing/debuffing, melee helping, & concentration kinds of spells an actual spellcaster would be unlikely to use. And not the damage & save-or-suck spells a caster likes.
But that was covered well enough by other people so moving to the actual reason I bothered to add comment:
Eldritch Knight and Arcane Trickster are honestly provided (both in 5e and BG3) as the excuse to have Int on a martial. That's their main purpose.
To let you put higher Int on you character for dialogue and roleplay purposes, without having to feel like you wasted your stats.
A build fitting option to go with your narrative desire to play a melee warrior that is smart.
As opposed to stacking Int on a barbarian that will never use it in combat, and make you feel like you gimped yourself.
Paladin, Bladelock, and Bard (if desired) are the excuses for Charisma on a martial, Monk is the excuse for Wisdom on a martial, and EK + AT are the excuses for Intelligence on a Martial.