Per a passage in a new Star Wars canon novel, Yoda had envisioned himself training Leia to take down the Sith, not Luke Skywalker. When Luke first encounters the wise Jedi Master on Dagobah in The Empire Strikes Back, Yoda is reluctant to show the youngster the ways of the Force because he fears Luke will suffer the same fate as his father, Anakin. Through their early interactions (when Yoda was putting on an act of being "insane"), the little green alien's worst fears about Luke were seemingly confirmed. Skywalker had a quick temper, little patience, and craved adventure. Yoda was swayed by Obi-Wan Kenobi's faith in the farm boy-turned-hero and Luke's promise that he wouldn't fail. Left with no choice if the Empire was to be vanquished, Yoda agreed to teach Luke.
At the end of Empire's second act, Luke lets Yoda down when he impulsively leaves Dagobah so he can attempt to rescue Han Solo and Princess Leia on Cloud City - despite the pleas of his mentor. Both Kenobi and Yoda are afraid Luke is about to take the "quick and easy path" by jumping headfirst into a task he isn't ready for. Luke, however, stayed loyal to his friends, and flied off, leaving Yoda to contemplate the future. When Obi-Wan bemoaned that Luke was their last hope, Yoda reminded him there was another. This mystery was resolved in Return of the Jedi when it was revealed Luke and Leia are brother and sister, and Yoda had always felt Anakin's daughter was the better option of the two.
To celebrate the 40th anniversary of A New Hope, the novel Star Wars: From A Certain Point of View was published. The book is a collection of short stories set during the events of that seminal film, allowing readers to experience the story from the perspectives of background and side characters. One chapter, called "There is Another," takes place on Dagobah and follows Yoda as he migrates to the other side of the planet as the seasons change. Settled in his hut, Yoda has a conversation with the recently-deceased Obi-Wan about their next move. When Kenobi asks Yoda to train "young Skywalker," Yoda eagerly accepts, thinking Obi-Wan is referring to Leia. He is disheartened to learn Obi-Wan is instead requesting for Luke be the apprentice, but Yoda obviously agrees and tells Obi-Wan to send Luke to Dagobah.
Yoda's hesitancy stems from his belief Luke lacks the serious mindset necessary to become a Jedi Knight, sensing great anger in Anakin's inattentive and headstrong son. Yoda preferred Leia since she seemed to posses the traits typically found in "great Jedi." As many Star Wars fans know, the Princess is strong-willed, determined, and always focused on the task at hand. These are the qualities that made her such a valuable leader for the Rebel Alliance - even when she was just a teenager. Obi-Wan's exact reasoning for choosing Luke over Leia is unknown, but those familiar with the films can piece it together. Watching over Luke for nearly 20 years, Obi-Wan obviously grew fond of the boy, and recognized Luke had a kind heart - regardless of any flaws. Plus, Obi-Wan saw a little of himself in Luke (he was reckless once upon a time, too), which gave him confidence Skywalker wouldn't stray from the right path. Obi-Wan had been through a lot in his life, and always resisted the dark side. Plus, Leia was bound by her duty to the Rebellion and could not afford a detour to a swamp to train with Yoda.
Ultimately, Obi-Wan's intuition proved to be correct, and (at least at the time), Luke was able to save the galaxy by bringing his father back to the light side - defeating the Sith in the process. Of course, in the three decades since the Battle of Endor, Luke attempted to start a new generation of Jedi and failed when Ben Solo became Kylo Ren. In the event a Yoda Force ghost appears in The Last Jedi (as has been heavily rumored), it will be interesting to see what Luke's interactions with Yoda are like. If Yoda doubted Luke's abilities from the start, any conversations between the two have the potential to be quite fascinating and revealing.
Source: Star Wars - From A Certain Point of View