The reason for his imprisonment probably explains why he chose to use the term middle wall of separation in Ephesians 2:14 Ephesians 2:14For he is our peace, who has made both one, and has broken down the middle wall of partition between us;
American King James Version×to represent man-made and discriminatory decrees that alienate and divide people.
Paul’s imprisonment resulted from a false charge that he had taken a gentile with him past a forbidden checkpoint in the temple compound (Acts 21:29 Acts 21:29(For they had seen before with him in the city Trophimus an Ephesian, whom they supposed that Paul had brought into the temple.)
American King James Version×). In an article titled “The Wall Is Gone,” Craig McMahon gives this revealing observation of why that dividing “wall of separation” was likely so prominent in Paul’s thinking.
“The most promising [explanation] … identifies the ‘dividing wall’ with the temple wall that cordoned off the Outer Court of the Gentiles from the various inner courts of the Jews. Rhetorically speaking, this temple wall functions as a poignant metaphor of the social and spiritual exclusion of the Gentiles by the Jews. No Gentile was allowed to pass beyond this five-foot high stone wall into the Jewish section of the temple …
“Historically speaking, this same temple wall played a pivotal role in the course of Paul’s ministry. Acts 21:26-36 Acts 21:26-36  Then Paul took the men, and the next day purifying himself with them entered into the temple, to signify the accomplishment of the days of purification, until that an offering should be offered for every one of them.
 And when the seven days were almost ended, the Jews which were of Asia, when they saw him in the temple, stirred up all the people, and laid hands on him,
 Crying out, Men of Israel, help: This is the man, that teaches all men every where against the people, and the law, and this place: and further brought Greeks also into the temple, and has polluted this holy place.
 (For they had seen before with him in the city Trophimus an Ephesian, whom they supposed that Paul had brought into the temple.)
 And all the city was moved, and the people ran together: and they took Paul, and drew him out of the temple: and immediately the doors were shut.
 And as they went about to kill him, tidings came to the chief captain of the band, that all Jerusalem was in an uproar.
 Who immediately took soldiers and centurions, and ran down to them: and when they saw the chief captain and the soldiers, they left beating of Paul.
 Then the chief captain came near, and took him, and commanded him to be bound with two chains; and demanded who he was, and what he had done.
 And some cried one thing, some another, among the multitude: and when he could not know the certainty for the tumult, he commanded him to be carried into the castle.
 And when he came on the stairs, so it was, that he was borne of the soldiers for the violence of the people.
 For the multitude of the people followed after, crying, Away with him.
American King James Version×recounts the story of Paul having been seen in the exclusively Jewish area of the temple with some strangers, one of whom was assumed to be a Gentile, Trophimus of Ephesus.
“Jewish worshipers seized Paul, making the accusation that ‘he has even brought Greeks into the temple and has defiled this holy place’ (v. 28). This allegation charged that Paul was guilty of aiding Gentiles in breaching the dividing wall …
“If in fact Paul wrote Ephesians during this lengthy period of imprisonment … then the acknowledgement in Ephesians 3:1 Ephesians 3:1For this cause I Paul, the prisoner of Jesus Christ for you Gentiles,
American King James Version×(‘I, Paul, the prisoner of Christ Jesus for the sake of you Gentiles’) may be an historical reminiscence of his arrest for allegedly violating the restrictions of the temple wall …
“Paul’s mention of the dividing wall … fits the probable historical context of Ephesians and is also well-suited to the rhetorical purposes of this passage—namely, depicting the former separation between Jew and Gentile and the new order created in Christ” (Review and Expositor, Spring 1996, p. 262).