Admittedly, this is a very difficult passage because Paul here involves himself in an Old Testament practice regarding purification (and the New Testament is clear that our purification today is made possible ultimately by the blood of Christ). So, did Paul give in to peer pressure here and sin? Some believe so, but I am not of their number. If I was to be involved in a Mosaic purification ritual today, I would be sinning in so doing, but Paul's situation here was unique and temporary in several ways. Allow me to explain briefly.
Before this incident occurred, the Holy Spirit had moved Paul to write epistles to the Galatians and Romans, in which God said that people were no longer under the "tutor" (i.e., the Old Law); they were delivered from it, and they were dead to it (Gal. 3:24,25; Rom. 7:4-6). Thus, there is no doubt that the Old Testament was no longer binding as law when Paul did what is recorded in Acts 21:26. Yet, James and the elders advised Paul to do things that were part of that Old Law, and Paul did do these things. Thus, it certainly appears they sinned by advising and doing these things.
But, there is no condemnation given by God through Luke or any other inspired prophet. Why didn't God expose what Paul, James, and the elders did as sinful? After all, Peter was rebuked to his face by Paul when his behavior was sinful (cf. Gal. 2:11ff). Similarly, God exposed the sins of other key Bible characters on the pages of His word. Again, why was there no rebuke of Paul, James, and the elders by God, Peter, or other apostles and prophets? Could it be that, although the Law had indeed been nailed to the cross and taken out of the way (cf. Col. 2:14), the influence of that Law continued until the destruction of Jerusalem? Is that not what God meant when He said that the Old Law was "passing away", "growing old", and "ready to vanish away" (II Cor. 3:11; Heb. 8:13)?
Certainly, people were bound by the New Testament (that is, the portion revealed to them at that time) and had to obey it in order to be saved from their sins. They had to worship God in accordance with the New Covenant rather than the Old Law. However, during this transitional time, some of the requirements of the Old Law were still being kept by some Christians with Jewish backgrounds. But, it is clear that these actions were taken as matters of liberty, expediency, or indifference, and they were not required for salvation. This is true because no one could be justified (or saved) by keeping the Old Law (cf. Rom. 3:20,28). Thus, Paul took these actions not because he had to, and not to be saved, but to avoid being a stumbling block to Christians with Jewish backgrounds and others during this transitional period. As Paul wrote in I Corinthians 9:20 - "And to the Jews I became as a Jew, that I might win Jews; to those who are under the law, as under the law, that I might win those who are under the law." This is how Paul could circumcise Timothy as an indifferent matter (cf. Acts 16:3) but refuse to allow Titus to be circumcised as a matter required for salvation (cf. Gal. 2:1-5).
We also need to keep in mind that during this transitional period, they did not have the complete New Testament. Indeed, even Paul and other inspired apostles and prophets only knew and prophesied "in part" until the "perfect" (that is, the completely revealed will of God) came (I Cor. 13:9,10; Eph. 4:13,14). Their understanding was "in part" because the whole body of truth had not yet been completely revealed and because it often took time for the truth which had been revealed to be applied as God intended it (e.g., Acts 2:39).
Therefore, James, the elders, and Paul thought (at this time) that Jewish Christians could perform acts of the Law of Moses, not as necessary to salvation, but because they were Jewish citizens of the theocratic state of Israel. Thus, they viewed their recommendation and Paul's actions as an expedient to further the gospel (cf. I Cor. 9:19-23).
As a side note, wasn't there a similar, though shorter, period of transition from Patriarchy to the Law of Moses? It took time for the tabernacle and its items to be constructed and prepared for use in worship. There was a necessary period of transition because although God's will had clearly been revealed on Mount Sinai to Moses, He had to give the Israelites time to adjust to the changes. In Paul's day, the destruction of Jerusalem in AD 70 would mark a formal end to the theocratic state of Israel established under Moses as well as the forty year transitional period mentioned above (from 30 - 70 AD).