Recently while watching Twin Star Exorcists I noticed the main character using a Sanskrit spell. Why is that the case? Why don't they use native Japanese spells instead?
per Wikipedia on Sanskrit
Sanskrit (/ˈsænskrɪt/; Sanskrit: saṃskṛtam [səmskr̩t̪əm] or saṃskṛta, originally saṃskṛtā vāk, "refined speech") is the primary sacred language of Hinduism, a philosophical language in Hinduism, Jainism, Buddhism and Sikhism, and a literary language that was in use as a lingua franca in Greater India.
While Japan's native region is way back when was Shintoism during the Nara period Buddhism was making it's way into Japan and was structurally established within Japan by Emperor Shōmu sometime during his reign between 724–749 being a devout Buddhist himself.
During this time, Buddhism becomes structurally established within Japan by Emperor Shōmu (reign 724–749), and several large building projects are undertaken. The Emperor lays out plans for the Buddha Dainichi (Great Sun Buddha), at Tōdai-ji assisted by the Priest Gyogi (or Gyoki) Bosatsu. The priest Gyogi went to Ise Daijingu Shrine for blessings to build the Buddha Dainichi. They identified the statue of Viarocana with Amatarasu (the sun goddess) as the manifestation of the supreme expression of universality.
Soruce: Shinto - History - Nara Period
Shōmu, a devout Buddhist, is best remembered for commissioning, in 743, the sixteen-meter high statue of the Vairocana Buddha (the Daibutsu) in Tōdai-ji of Nara.
Source: Emperor Shōmu - Legacy
Buddhist texts in Japanese are strange things. As the informed reader is aware, Buddhism originated in India, and as such, many of the foundational texts of Buddhism were originally written in Sanskrit. When Buddhism moved into China, those Sanskrit texts were translated into whatever the contemporary form of Classical Chinese was. Eventually, those texts made their way from China into Japan.
the exact reason as to why they would use that? if i was to make an assumption it would be because it's an old yet mystical language from a age long gone and normally (from what i have seen) old languages are generally used for magic such as with the Merlin series the Spells used in it were literal commands (like Open, Copy, Burn) translated to Old English or Lancer in Fate/Stay Night using Northern European Runes
Lancer obtained 18 Original Runes, Norse Runes, after studying magecraft under Scáthach in the Land of Shadows
^ you can see 3 of the 4 Runes Lancer uses in Ath nGabla. the 4 runes being Algiz, Nauthiz, Ansuz, and Ingwaz
You can find an English language equivalent (English using spells spoken/written in Latin) easily.
For example, any of the Harry Potter books.
Lumos, for example, for light.