Ammonia is more basic than phosphine because
In phosphine, the H-P-H bond angle is 90∘ while the H-N-H bond angle is 107∘.
Bond angle of 90∘ in: PH3 indicates that in PH3 formation of P-H bonds involves pure orbitals of P. Thus its three p orbitals form bonds with three H atoms and the electron pair of s orbitals remains unused. So here the nonbonding electrons belongs to s orbital, while in: NH3, the nonbonding electron pair belongs to sp3 orbital. Now since lesser the s character of an orbital, farther it is away from the nucleus and hence s electrons are readily available for promotion. Hence, NH3 will be more basic than PH3.