A lot of people believe that the reason Einstein proposed the Cosmological Constant was to avoid having to postulate the expansion of space. Partly this is Einstein's fault: this is how he remembered his own history, later in life. But it's not actually what happened.

Einstein wasn't worried about expansion one way or the other when he developed GR.

It's true that around 1917 he thought that the universe was static (just by default, with no evidence to the contrary), and it's true that it was partly Hubble's work that made him give up on the Cosmological Constant later; but his motivation for introducing it had nothing to do with expansion. It was motivated by consideration of boundary conditions at a SINGLE time.

A bit more detail, from pp.806-807 of John D. Norton, "General covariance and the foundations of general relativity: eight decades of dispute", Rep. Prog. Phys. pp. 806-807:

"By 1917, Einstein had found that a simple reading of the relativity of inertia was incompatible with his theory. He reported this failure in an introductory section (section 2) to his famous paper on relativistic cosmology (Einstein 1917). On the basis of the relativity of inertia, he expected that the inertia of a body would approach zero if it was moved sufficiently far from other masses in the universe. This expectation would be realized in the theory if the spacetime metric adopted certain degenerate values at a mass-free spatial infinity. However Einstein found that such degenerate behaviour was inadmissible in his theory. Instead he seemed compelled to postulate some non-degenerate boundary conditions for the metric at a mass-free spatial infinity, such as Minkowskian values.

This Minkowskian boundary condition became the embodiment for Einstein of the failure of the relativity of inertia. For this boundary condition made a definite contibution to the inertia of a test body that could not be traced to other masses. That is, with these boundary conditions, the inertia of a body was influenced by the presence of other masses, in so far as they affected the metric field. However its inertia was not fully determined by the other masses. Therefore, if the relativity of inertia was to be satisfied, it was necessary to abolish these arbitrarily postulated boundary conditions. (The question of whether this was also sufficient remained unaddressed.) Einstein succeeded in abolishing these boundary conditions at spatial infinity by a most ingenious ploy: he abolished spatial infinity itself. He introduced the first of the modem relativistic cosmologies, the one we now call the ‘Einstein universe’, which is spatially closed and finite. The price Einstein had to pay turned out to be high. In order for his field equations to admit the Einstein universe as a solution, he needed to introduce the extra ‘cosmological’ term in his field equations."