Why do the Sanhedrin eventually let the apostles go?
Acts 5:40 (ESV)
40and when they had called in the apostles, they beat them and charged them not to speak in the name of Jesus, and let them go.
The Sanhedrin repeat their prohibition on teaching and speaking in the name of Jesus (cf. Acts 4:19). They hope that the flogging will now serve to shake the apostles so that they go back to their hometowns and normal professions.
40 and when they had called in the apostles, they beat them and charged them not to speak in the name of Jesus, and let them go.