Whenever you meld materia, not only do you have to be sure that the item level is high enough to actually hold the materia, but there is an internal cap for every upgradable stat in each item. When you meld, it will show a info box with the "effective amount" of points in that stat which will be applied to the item. Any extra points won't be applied regardless of how much materia you throw at it.
Let's say the internal cap for craftsmanship on a particular item is 4. Even if you use a Craftsman's Competence IV materia (+6) it will still only apply a +4 bonus. There are even some items that can't have certain stats upgraded at all, and yes it hurts when you meld a 40-80k piece of materia to a piece of gear that only gives a +1 or +0 bonus for it since it both ruins the materia and the piece of gear.
As a basic rule of thumb, try to read the entire info box and if you're not getting the full benefit from your rank IV materia, then it may be wiser to use a lower rank so that it doesn't hit your wallet quite as hard.