Because the initial leader and creator of the Akatsuki was Nagato, and Obito needed the Rinnegan and manpower in order to complete Madara's plan.
After Yahiko's death, Nagato had a drastic mindset change and decided to follow Obito's and Madara's plan, so Obito joined Akatsuki and became their...