I think you are trying to over-elaborate your analysis. The sentence is not that complicated. The subject of the verb 'to be' is the pronoun 'it' (standing for 'under the acacia tree'), and the object is 'a dirty place'. "To sit" is is a relative clause, which is (legitimately) missing its relative pronoun.
The sentence is a contraction of "Under the acacia tree was a dirty place in which to sit."
- For Teachers