I was flying from Kiev through Munich and Frankfurt to US. In Kiev I was refused a registration for the flight by airport official due an absence of Schengen visa. I had also just a carry on language, no check in. I presented my green card, but he said it did not matter. I had to buy another ticket, which was expensive, directly to USA. Was that a correct action of the official?
On your proposed itinerary, you would have been required to clear immigration and customs at Munich, before changing to your domestic flight to Frankfurt and there going through exit controls for your flight to the USA. If you don't have a Schengen visa, nor are exempt from holding one, you would have been refused entry at Munich, and the airline was correct to deny boarding.
Your green card means nothing, if you're a citizen of a country that requires a visa to enter the schengen area you would have been denied in munich. If you're a citizen of a country that doesn't require a schengen visa then you should have been allowed on the flight and would have got a schengen stamp in munich.
Basically, your itinerary was supposed to be:
City 1 (country A) — city 2 (country B) — city 3 (also country B) — city 4 (country C)
Notice that city 2 and city 3 are in the same country. Every country I know of has rather lenient laws about flying from one place inside that country to another. They assume that this type of flight will be heavily used by locals of city 2 or city 3 for domestic travel. The procedure to get on one is basically check in, go through security screening so you don’t carry goods not allowed on planes, go to the gate, confirm you’re still the same person (e.g. boarding pass), fly. When you arrive on the other side, all you have to do is exit the plane and then the airport — no customs, no immigration because you are still in the same country.
International flights, like the first and third leg of your journey, are typically an entirely different story. There will typically be an immigration check when entering the other country. Again, every country I know of wants to know who enters and reserves the right to refuse certain parties at their border. Part of what defines a sovereign nation: the ability to control who crosses your borders.
Since this is a major difference, international flights and domestic flights are often physically separated within an airport. You will be at different gates, sometimes different terminals altogether. There will typically be no mixing of international and domestic departing travellers airside — which also includes international and domestic transferring passengers, as you would be one.
Applying all of this to your itinerary, every country I know of will want you to pass through immigration at city 2, because you are now entering country B. You will transfer into a domestic part of the airport before you board your second flight. When your second flight arrives in city 3, you could just ignore the final leg of your journey and stay in country B. This is especially true if you’re only carrying hand luggage.
Hence, to be allowed to board the flight to city 3, you need to formally enter country B — have the required prerequesites (visa), and be allowed to enter by the immigration officer on duty at city 2. They will check it and stamp you in. Over at city 3, you will again have to formally exit country B before being boarding your third flight. Thus, you need to be legally allowed to enter country B.
It is the airline’s duty and responsibility to check on check-in that you are actually allowed to enter all the countries you are entering during your itinerary — they do this by confirming that your passport’s validity fits the required criteria and that any required visa are present. Sometimes this also includes required transit visa, even if you remain airside and never formally enter a country you’re transferring through. If the airline fails to perform reasonable checks and you are denied entry into a country, they must transport you back to where you came from and they may be liable to pay a fine. They want to avoid that. Hence they do perform these checks and err on the side of caution.
In your case, your domestic leg is in Germany. You must either have a passport that allows you visa-free visits to Germany or you must have a visa for entering Germany. A transit visa is not enough! If you are a holder of multiple passports, then only one of those must allow you to enter Germany, since immigration never asks for all passports a person owns (only ever one). I assume (but we do not know until you enter your citizenship into the question) that you are not a national of a country whose residents are allowed to enter Germany visa-free (since you got refused by the airline which should never happen on a ‘good’ passport). And I also assume that you do not hold a corresponding visa — same argument.
A US Green Card is not a passport. It is not an official document of citizenship and thus it cannot be used to determine whether you are allowed to enter Germany or not. Your holding a Green Card is completely irrelevant for all legs of your flight save the final one.
: The most prominent (but not the only) exception to this distinction between international and domestic is the Schengen area. For the intents and purposes of this answer, the Schengen area can be considered a single macrocountry, although that it not the entirely correct picture. However, there are no passport controls on intra-Schengen flights, and they typically depart from the same areas of airports as domestic ones do, often using the exact same gates.
: Note that it is very possible for international and domestic arriving (not transferring) passengers to mix after the former went through immigration control. This allows for a single set of luggage reclaim area and hence an easier airport building layout.
: Formal meaning to go through an official process not to technically go through a process while not actually doing it.
: As hinted above, Germany is part of the Schengen area. Hence, a visa ‘for Germany’ will always be the corresponding Schengen visa. And indeed, the idea would have been the same if you had chosen a route Kiev–Munich–Paris–USA. Kiev–Munich–London–USA would probably have worked (as according to phoog’s answer, a Green Card exempts you from the requirement of acquiring a Schengen transit visa. You still need to make sure you can transit London though — and again, it can only work if it’s only one London airport).
Your green card qualifies you for an exemption from the requirement to hold an airport transit visa. Those visas, however, are for itineraries that do not require passing through Schengen area passport controls. Your itinerary included an internal Schengen flight, so you did have to pass through passport control, so you needed a regular Schengen visa, for which a green card does not allow any exemption.
The airline was therefore correct to deny boarding.
Since you're flying from Munich to Frankfurt, you have to get from the International Area to the EU-Area and yes, for this you have to enter the EU, so a Schengen Visa is necessary.
Then in Frankfurt you would leave the country again and get checked by the TSA officials before boarding the Flight to the USA. Even thought you already been security checked, you will get checked again, in Munich and Frankfurt, since you will transfer into the EU and back. And yes, you could e.g. also run away in Munich or Frankfurt without further control.
It would be different if you have a direct flight from Munich to the USA, since you wouldn't have to leave the international Area.