Many have questioned Thanos' decision to take the risk of giving someone like Loki, who is wayward and prone to trickery, the incredibly valuable Mind Stone and relying on him to secure the Space Stone for him. As we know, he failed in his mission which is perhaps the only failure that the original Thanos (not the one who time-traveled) faced. This is rather inconsistent with the mighty Titan who had proven himself to be a maestro at making successful plans. But, if a recently postulated theory by a MCU fan is taken into account, his plans were much bigger than getting his hand on another Infinity stone and he actually succeeded.
Ever since Thanos was first introduced in the MCU, he was presented as a genius manipulator and almost every one of his plans worked except the time he tasked Loki with bringing him the Tesseract even though he possessed a deadly gigantic army of his own. So, how could someone like Thanos commit such an error in judgment? Well, as per a very much plausible theory by Redditor TheMediocreCritic, the Titan had a much bigger plan in mind, and giving Loki the Mind stone secured its future success- the fall of Asgard which in turn allowed him to invade Nidavellir unabated and force Eitri to make him the Infinity Gauntlet, which allowed Thanos to wield the combined power of the stones.
According to the brilliant theory, while it appeared that Thanos only manipulated Loki with the lure of power, he was actually orchestrating the chaos to weaken the Asgardian empire and it worked. Even though Loki failed in securing the Space stone for him and also lost the Mind Stone in the process, his actions destabilized Asgardian and set the Ragnarok prophecy into motion.
Thanos knew that the Nine Realms were already in chaos since Loki's deception in Thor resulted in the destruction of the Rainbow bridge. But it was the 2012 events in New York that caused Odin and Thor to become too focused on Loki. They became too distracted to notice that someone like Thanos could take advantage of their diverted attention. After Loki ended up being a catalyst in the attack by the Dark Elves on Asgard in Thor: Dark World and faked his death, he cast a strong enchantment on his father, Odin, banished him to a retirement home on Earth, took upon his appearance, and began ruling Asgard with a total disregard for the safety of the rest of the Nine realms.
He is the reason that the prophecy of Ragnarok, i.e., the destruction of Asgard became a reality and left the Nine Realms bereft of what little protection they had, allowing Thanos to invade Nidavellir and force the Dwarves to make the Infinity Gauntlet to harness the power of the Infinity Stones. This would not have been possible if Odin and Thor were still in charge and Heimdall wasn't exiled by the fake Odin/Loki. He would have seen the attack on Nidavellir coming, allowing the mighty forces of Asgard and Thor to arrive before Thanos did.
The theory postulates that Thanos was aware of the impossible chances of his army beating the Asgardian army and thus, he opted to orchestrate this long term plan to cause the fall of Asgard. That's why he risked giving Loki the Mind Stone, despite being aware that the Asgardian prince was renowned for backstabbing and trickery, as he knew that without a device to harness the combined powers of the Infinity Stones, even possessing them all would be of no use for his annihilating-half-the-universe plans.
So, what if Loki had succeeded in securing the Space Stone? In the unlikely scenario where Loki managed to defeat the Avengers, possibly kill Thor, nab the Tesseract, and lay waste to New York, Thanos would have still succeeded. Not only would he have the Space Stone, he would have also invaded Nidevellir as then Odin would have been focusing his entire attention and Asgardian Army in fighting the massive Chitauri fleets and bringing Loki to justice, unaware that he was being aided by Thanos. The theory holds up on both counts, as in either scenario Thanos succeeds in sowing discord in Asgard to get what he wanted. You can check out the theory here. This theory originated at Reddit.