Nothing in terms of human society and politics is inevitable. The North could have simply allowed slavery to expand. The South could have accepted being hemmed in. The North could have let the South secede. There is nothing that is inevitable when it comes to wars or other human actions like this.
That said, the closer the country came to 1861, the more inevitable the war became. It could still have been prevented, but it would have been much harder to do so and would have taken more moral courage on the part of political leaders. The reason for this is that, as time went by, more and more issues arose between the two sections of the country. These issues drove them further and further apart.
In 1820, for example (or even 1840), there were not yet many issues that had divided the North and South. They had crafted the Missouri Compromise and seemed to have the issue in hand. From then on, however, more and more issues arose. The Mexican War split the two sections. The Kansas-Nebraska Act did the same. So did the Dred Scott case. The point is that issues arose and grievances accumulated. As this happened, it became harder and harder for the sections to feel as if they could continue to get along together as part of the same nation. In that sense, we can say the war was inevitable.