I'm pretty sure that I was the one that came with the idea for adding them to generic text widgets when I implemented that in KDE (originally to add spell checking in KMail, since spell checking in email clients wasn't a thing yet). At that time spell checking was only done in word processors. Pretty quickly every other environment, including Windows and macOS followed suite.