Why is ammonia more basic than acetonitrile
p orbitals are higher in energy than s orbitals.
sp3 orbitals with 75% p-character are therefore higher in energy than sp orbitals with 50% p-character.
This means that the lone pair in ammonia is higher in energy than that in acetonitrile.
Higher energy lone pair corresponds to greater basicity.


No need to bring electronegativity into the picture.

For a similar question see Relative acidities of alkanes, alkenes, and alkynes