For Sokka, he felt out of place in terms of the rest of the team because they were benders of some kind, and he was just a warrior. So, the others decided he needed a master too. Enter Piandao, the greatest swordsman in the world. He only would train those worthy however. Sokka appealed to him, and he did deem him worthy.
Unlike other masters though, Piandao understood the need for skills other than just swordsmanship. He valued creativity, the use of environment to ones benefit, and more. It was these skills he taught to Sokka, which were honestly skills perfect for him.
After his training, Piandao gave Sokka his blessing to go and be the best swordsman he could be. Piandao returned at the end of the series as a member of the White Lotus who took back Ba Sing Se.