Why we don't use the least-square objective function for GLMs? I am familiar with OLS, in which we minimize the sum of squared residuals to obtain the estimator. Why do we not use the same approach for GLM, but instead use maximum likelihood estimation?

I think you are confusing levels of explanation. maximum likelihood also minimises an objective function. in particular for gaussian errors and linear regression you get OLS. for binary responses you get log loss objective function.
Maximum likelihood identifies the objective function based on a particular model of your data, which means that you can draw further conclusions, eg getting confidence intervals on your parameter estimates.
