Needed to be 是修饰前面的名词walls, to make, 这个to是动词不定式,表示目的。改写:……walls needed to be in order to make ……
to be to make 和 to make 所不同的是: to be to make 表示强调将来。