A negative charge is formed on -carbon of an ester and N,N-disubstituted amide when thebase abstracts the proton. The negative charge undergoes delocalization with the carbonyl group and the lone pair of ester oxygen and nitrogen of amide have lone pairs which has a chance to undergo delocalization with the carbonyl group. Hence, the negative charge formed on -caron is not readily delocalized into carbonyl oxygen.
The stabilization is shown as follows:

The lone pair of nitrogen is much more readily undergoing delocalization compared to oxygen, because of more stabilization of positive charge on nitrogen compared to oxygen. This makes the negative charge of -carbon which will not readily undergo delocalization in the case of N, N- disubstituted amide.
Whereas in ester, the positive charge on oxygen is not stable due to the more electronegative nature of oxygen. Hence, the -hydrogen of N.N-disubstituted amide is less acidic than the hydrogen of ester.