https://japanese.stackexchange.com/questions/1395/what-is-the-difference-between-the-nominalizers-こと-and-の
Both "のは" and "ことが" can be used to nominalize a verb, but they have slightly different nuances.
So, which one to use depends on the context and the level of formality you want to convey. In the sentence "挨拶するのは大切です," "のは" is used because it's a more casual context.