That is because the file itself is corrupt, as it is not a .doc file rather an HTML document to sign in to Google that has been downloaded as the file you wanted to download.
What you need to do is, check whether Google is authenticating your request or not. You did not include the code to authenticate the users; — how are you doing that? OAuth2? Key?
That entirely depends on how you authenticate the users, perhaps start here, About Authorization | Drive REST API | Google Developers
]. Also a small excerpt from their page,
Quote:Your application must use OAuth 2.0 to authorize requests. No other authorization protocols are supported. If your application uses Google Sign-In, some aspects of authorization are handled for you.
But how Google Sign-In helps you out, I am unsure of that in this context, thus OAuth2 would be a good way to go.