In reading the Wikipedia page on Thanos (
https://en.wikipedia.org/wiki/Thanos), specifically his biography, it would appear that Thanos is a fictional god or god-like being and a personfication of the philosophical concept of nihilism. In addition, according to his Wikipedia page, he "...[worshiped] and eventually [fell] in love with the physical embodiment of Mistress Death." This is intersting because whereas nihilism is a Western philosophical idea which arose in the 19th century (
https://www.britannica.com/topic/nihilism), the idea of worshiping a personal deity in order to attain enlightenment is a much older Hindu idea. We the similarity in Hinduism with the Sadhu (Hindu Holy Men) who do this. The "Mistress Death" is reminiscient of Yama, the Hindu god of death - "Yama (Sanskrit: यम), also known as Kala, and Dharmaraja is the Hindu god of death and justice, responsible for the dispensation of law and punishment of sinners in his abode, Yamapuri.[12][13] He is often identified with Dharmadeva, the personification of Dharma, though the two deities have different origins and myths" (
https://en.wikipedia.org/wiki/Yama_(Hinduism)).
The story, however, surrounding Thanos does not appear to have roots in the concept of being a holy man... "Sādhu means one who practises a 'sadhana' or keenly follows a path of spiritual discipline" (
https://en.wikipedia.org/wiki/Sadhu). The Wikipedia article on Thanos continues, "Wishing to impress Mistress Death, Thanos gathers an army of villainous aliens and begins a nuclear bombardment of Titan that kills millions of his race." This is more akin to Judeo-Christian theology as well as reminiscient of the fictional works of Tolkein, in which one tries to spread their religion to others because they believe God wanted them to. In addition, if Thanos did this to impress his deity, the motivation would not be spiritual. It is written that "Thanos eventually locates the Cube, and also attracts the attention of Mistress Death." Assuming this to mean that she approved of his actions, the real-world religious basis of the narrative appears to begin to fall apart. It is written: "Willing the Cube to make him omnipotent, Thanos then discards the Cube." Prayer to an inanimate object is simple idol worship. Or, the story may also be seen as the limitations of using one's will in order to effect a change (i.e.: if the cube is destroyed (one runs out of willpower) then they become powerless).
Next, the Wikipedia article writes, "During this alliance Thanos cultivates a plan to reunite with Mistress Death, and secretly siphons off the energies of Warlock's Soul Gem, combining these with the power of the other Infinity Gems to create a weapon capable of destroying a star." The idea of energies existing in the universe is also reminisicent of Hinduism, as well as New Age religions. The idea that a gem may hold energy is reminiscient of Paganism and New Age, and probably others, as well.
The rest of the biography appears to combine ad-hoc elements of different religions in order to excite the reader in order for the company who owns the intellectual property of Thanos to increase profits. This is an example of cultural appropriation because elements from different cultures are combined in a way that disrespects the cultures from which they originated.
I can't directly comment on the events you talk about, but based on my readings of Thanos' biography, it would appear that Thanos wasn't trying to pursue his own spiritual improvement. According to Buddhism, this would mean that his actions must necessarily eventually cause harm to others (due to ignorance of one's true nature) and not being on the path.