Christian church leaders like James were addressing what they consider a false accusation being made against the Apostle Paul.
21 and they have been told about you, that you are teaching all the Jews who are among the Gentiles to forsake Moses, telling them not to circumcise their children nor to walk according to the customs.
They suggest some solution to the problem with this conclusion
vs 24...so that they may shave their heads; and all will know that there is nothing to the things which they have been told about you, but that you yourself also walk orderly, keeping the Law.
acts 21, here it is again..
First read this.

.
Gal 4:12 Brethren, I beg of you,
become as I am [free from the bondage of Jewish ritualism and ordinances], for
I also have become as you are a Gentile]. You did me no wrong [[f]in the days when I first came to you; do not do it now].
Pro law people love to shout out happily
Paul went to the Temple and took the ritual!
Lol
they forget that he did not go to Jerusalem for 14 years as per Gal 2:1, which says again, presumably after the Peter visit of Gal 1:18, 3 years after Pauls conversion, and it was for just 15 days, no temple time there, so really 17 years total, Acts 9 leaves no temple information either.
So no feasts, no cleansing, no practicing Judaism for 17 years.
Acts 21. Paul goes to Jerusalem with his heart wide open, even bringing money he collected from the Gentiles, to show good will and unity. Paul arrives in Jerusalem, only to hear from James that the thousands there, many law following believers, thought Paul taught apostasy in verse 21, the Greek for forsake Moses, same word used in Thessalonians about the Antichrist, serious accusation. Did Paul preach it was ok to commit adultery or steal? No. Did Paul preach apostasy? No. In Romans 3:8 Paul said they lied about his teaching making like Paul said do evil, so good will come. He said their condemnation will be deserved. This confirms that James knew what many thought, incorrectly of course, concerning what Paul taught. And Paul knew it too (Rom 3:8), hence answered sin questions are seen in Romans 6. Do we continue in sin Paul asked, then said no! James and Paul both knew what the masses thought.
James, understandably fearing the thousands said, "do what we tell you", to Paul. Did Paul have to? No, but the language sounds strong, James saying do what we tell you, not an order, but an emphatic emphasis, a tone, stress, a very concerned James, can not be denied in those words. So Paul, who said in 1 Corinthians 9, that he did certain things to further the gospel, become as a Jew or Gentile etc, along with 2 Corinthians 4, while saying he commended himself to others, he then commended himself to James in Acts 21. Keep in mind, after James wanted Paul to take the ritual, James reminded Paul how he helped Paul earlier at the council meeting in Acts 15. So now it was Pauls turn to reciprocate with James. Fine, both helped each other.
So yes, Paul did the ritual, no big deal really, so what!? In a transitional stressful time, in an unfolding history of the apostleship of Paul and the church, along with the integration of Jew and Gentile populations, and all of the other things going on then, Paul did not want to freak out James, he took the vow. So what? It was the way for thousands of years anyway, it is not like he worshipped an idol or pagan God or something. Besides, that whole temple was going down soon anyway. People get so carried away with Acts 21, for no reason, other than to think they got Paul!
I say, good for Paul! He can't win anyway, if he didn't take the vow, people today, would find fault with that too. They would say
.
"Evil Paul, would not show love to James"
"Proud Paul!"
"Big shot apostle!"
When he takes the vow, they cry hypocrite.