Dr. Wiseman was trying to capture a Shiny Noctowl so that he could study it. He wanted to figure out why it was colored differently than the other Noctowl. However, the Noctowl was constantly outsmarting him, and always caught on to his plans.
Wiseman enlisted the help of Ash and his friends to try to get the Noctowl, but the plan came to a halt when Team Rocket came in and tried to steal the special Pokémon. Ash, not wanting Noctowl to get hurt, freed it from Team Rocket's mecha. To return the favor, Noctowl told Ash's Pokémon its plan to defeat Team Rocket. It worked, and they sent them blasting off.
Afterwards, Dr. Wiseman decided to give up on trying to catch the Noctowl, realizing that it wanted to stay with Ash, who then captured it.