Why wasn't the Susanoo used? During their fight with Kaguya, Obito, or even Sasuke didn't use their Susanoo which could have protected them from Kaguyas "Bone Ash" jutsu.

Same is the case when Sasuke fought Madara (Tobirama was lying on the ground paralysed and Sasuke jumped from above to attack Madara). Sasuke could have used his Susanoo, but he didn't.

Was this just a loophole on the writer's part? Or is there a reason behind it?
Kaguya can absorb all forms of ninjutsu, which rendered Susano'o useless. Sasuke only uses techniques like that on people who dont absorb jutsu, like Naruto. Plus, there would be no need to use Susano'o on Madara's Limbo Clone because physical attacks do not work on it. When he had chances to use Susano'o against Madara's Limbo, he didn't understand how the jutsu worked and might have felt there would be no need for its use. They have recently been putting Sasuke in situations where he doesn't need to use his stronger jutsu, like Kagatsuchi or Susano'o, which is why his fights have started taking way longer than they should be.
As for why Obito can't use it, there is literally only one manga panel that completely sums it up.

Obito had already given Kakashi his left eye by the time he awakened Mangekyou Sharingan, thus couldn't use Susano'o. Obito is later seen to get back both of his Sharingan, but since he awakened it before he had both, I guess the eyes could no longer be seen as a &quot;vessel&quot; for Susano'o to be used.