I saw this thread
and noticed that others seemed to have misinterpreted what the user was saying, so I decided to investigate.
I started a new game on story mode for ease of testing. Created a party of bard, fighter, archer, paladin, sorcerer, and shaman (included the three classes that the other OP said he was using).
When my bard got to level 2, she indeed had learned spells she shouldn't have: the shaman's Bless and Cure Light Wounds showing up in her mage spell book.
I learned the spells from upstairs in Pomab's and also leveled up again, and Bless and CLW still remained:
At this time I also noticed the sorcerer was able to cast Bless and CLW as well:
Notice there they are in his usable spell list at the bottom of the screen:
At this point I started over, wanting to do another test and observe more closely what was going on.
This time I created a bard, then shaman, then sorcerer in that order. Taught the shaman Doom and Sunscorch and the sorc Shocking Grasp and Spook (wanting to try out different random spells).
The three characters' spellbooks at the start of the game:
Nothing weird at all going on yet.
I then taught the bard the three spells from upstairs in Pomab's, just to see if doing so might affect or prevent whatever bug was happening:
Everything still normal.
The bard leveled up. This time, he learned the sorcerer's two spells and not the shaman's:
(For completeness' sake, the other two spellbooks when the bard leveled up...nothing weird happened to either of them at this point.)
Then I proceeded into the orc cave and all three characters leveled up.
Bard level 3, still with the sorc's extra spells:
Shaman level 2, now has learned the sorc's spells:
Sorc level 2, has not gained any spells:
So what does all this mean?
In the first game, the shaman was the bottom-most character, and in the second the sorcerer was the bottom-most.I think what is happening is that whenever a spellcaster levels up, they gain whatever first level spells the bottom-most character has...or perhaps the lowest spontaneous caster in the list, or something along those lines. Further testing is required.
Icewind Dale is a somewhat underplayed game among all IE games, so it's possible this isn't console exclusive and the same could happen to anyone, even on PC. Again, further testing is needed.
EDIT: Above thoughts were premature, see below for more conclusive workings of this glitch.