It was Yoda'a idea. Yoda thought it would be a good idea to give Anakin a padawan.
Yoda wasn't sure if Anakin Skywalker was reallt the Chosen One who would bring balance to the Force, but he did know that young Skywalker was wild and reckless and often let his emotions run wild. So, in an effort to teach him control, Yoda decides to give him a Padawan- the young and equally reckless Ahsoka Tano. Also, The jedi hoped that in teaching Ahsoka obediance to the council's orders, Anakin will reconsider his own disobediance. Instead, Anakin teaches Ahsoka that there are ways to disobey without being obvious about it.