I like to build Spear of the Magus because of my playstyle and comfort with the use of its passive, however, Obsidian Shard is still a very strong item and is better than Spear in some situations. To make the decision between Spear and Shard, just take a look at the following.
Do any of your abilities have ticking damage or deal successive damage in a single ability?
If the answer is yes, then Spear is the better option. Especially early game as the base magical protections of enemy mages (30 for all mages) is halved due to the flat rate of penetration on Spear. At max stacks on Spear’s passive, the target enemy’s magical protections are reduced by a 20 flat rate plus an additional 20%. The enemy mages will take true damage when you are at max stacks of Spear.
How much magical defence does the enemy have?
If the enemy has multiple magical defence items, for example, if the enemy jungler, solo laner and guardian all have Bulwark of Hope then the better option is to pick up Obsidian Shard. Obsidian Shard gives 70 magical power and its 33% penetration can be useful to get through large amounts of magical protections when taking down tanky enemies.
Does your team have another source of high magical damage?
For example, if you have a magical Solo laner or ADC the best option is Spear. This is because the magical protection reduction on Spear of the Magus increases the amount of damage that allied magical gods can deal to the enemies, with reduced protections. With Spear of the Magus, it is easier for your team to take down the enemies during team fights.
Both Spear of the Magus and Obsidian Shard have their best uses but they both have strong and weak situations. From an economic perspective, both items are very close in cost, so the decision between the two is not as difficult as choosing between Rod of Tahuti and Chronos’ Pendant. The decision is for the player to assess the situation and decide which item will be of most benefit.