According to the Jewish Law tradition written in Leviticus 14 any leper healed must bring two birds to the temple, one to be killed and the other to be set free. The Sadducees and Pharisees were looking for any way to charge Jesus with sin so they could kill him. If Jesus did not order the man to do this after healing him, then Jesus would be guilty of teaching something contrary to the law written in Leviticus 14 and thereby be guilty of sin. This would afford Jesus’ enemies the opportunity they were looking for to kill him in accordance with their laws. Now that you understand the motivation for Jesus ordering it, let’s consider what actually transpired.
Many times Jesus is said to have known people’s hearts as well as their pasts (woman at the well, John 4:17-18) and also their future actions (Peter denying Jesus three times in Mark 14:71-72, the tax coin in the fish’s mouth in Matthew 17:27, etc). And since it says in this story in Mark 1 that the leper who was healed did not follow Jesus’ instructions but instead spread the news of Jesus, I find it very likely that Jesus knew this would happen. So Jesus knew he wasn’t sending an innocent bird to its death for healing the leper. Instead Jesus healed the man and converted him into a believer who spread the news of Jesus, without Jesus breaking the law written in Leviticus.
This account mirrors the account of the woman caught in adultery (John 8:1-11) in a lot of ways, where Jesus would only permit the sinless among her accusers to stone her, despite stoning being the punishment written in the law for adultery. Jesus knew the Pharisees were just trying to catch him teaching something contrary to the law. But he found a way to show love without breaking the law, by saying “whoever is without sin cast the first stone (John 8:7),” knowing none of the accusers were without sin. This looks like the same type of thing happening.