The high degree of Christian ethics is highlighted in chapter twenty-three, especially when compared with the duplicity of the Jews in the next chapter.
Paul, before the Sanhedrin (who knows him well) asserts that he has fulfilled his duty to God in all good conscience.
Such an assertion is too much for the high priest, Ananias, who orders Paul to be hit on the mouth.
Paul reprimands him for this act of injustice and calls him a hypocrite (a “white-washed wall”).
Then Paul is reprimanded for insulting the high priest, at which point Paul apologized. He didn’t know he was the high priest.
We simply don’t know. Perhaps Paul had been away so long from Jerusalem he did not know who the high priest was. Perhaps Paul knew, but was making a comment regarding the unfitness of Ananias to be high priest. After all, it was to have been a hereditary office yet Ananias had been appointed by Herod of Chalcis, the brother of Herod Agrippa I (who put James to death in Acts 12). Herod of Chalcis was such a cruel and despicable fellow that he had been sent to Rome a few years before to give an accounting of himself to Caesar. He has been called one of the most unworthy men to hold the office of high priest.
Worthy or not, however, he was the high priest and Paul had insulted him. So, Paul apologized and when he does, Luke points out that while the high priest may not have been a close observer of the Law, Paul was.
Whether other people do what is right or not, whether they are ethical people or not, is irrelevant to our own behavior. We must not be guilty of breaking the law: neither God’s nor the law of the land.