This is almost certainly legal unless you're in a company that needs to comply with certain data protection regulations and the calendars contain protected data.
As to whether or not it's a good idea, why might it not be a good idea? Companies vary in how open they are with information within the company, how well they need to secure certain kinds of information, and how they do that. Especially in smaller companies that are either not dealing with a lot of data whose exposure could cause significant loss, there may be no serious issue with everybody in the company being able to see everything everybody else's calendar. Even in larger companies, moving towards more openness is a trend, though it's arguable how popular it is. For example, one of the design goals of team communication tools like Slack is to better expose conversations that had previously been hidden in e-mail, allowing someone not originally involved in an exchange to join a channel and see the full history of that exchange.
From your question it sounds as if you haven't really analyzed what information is in your calendars and what kind of problems could be caused by certain people seeing it. Problematic situations might include:
In a hospital, someone not allowed to access particular patient data being able to see that a certain doctor is meeting a certain patient. This would be an exposure of patient medical information, since you could guess things about the patient's medical conditions from that.
Someone not involved in the sales process being able to see that a salesperson is meeting with a certain company. It is often wise to keep quiet that a sale to a particular company is in progress lest competitors get wind of it and work to disrupt that sale.
So what information is in the calendars in question that poses some sort of risk if your manager's manager knows that information? This situation sounds to me as if it shouldn't be an issue at all, unless data protection regulations are involved. A manager well above you but still directly above you is usually considered trustworthy enough (except in very sensitive situations) that exposing to him what you're doing should not be an issue.
Opening your calendar to other employees at your level or below, or managers in a different part of the company, might be less wise. But even that (again, in the absence of data production regulation issues) is a business decision.
One thing you should do is inform your manager of this request, unless your manager's manager specifically requested you not do so. Your manager can raise the issue with his manager if he has any problem with this that needs to be worked out.