The reason for his imprisonment probably explains why he chose to use the term middle wall of separation in Ephesians 2:14 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). 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 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 ('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).