Generally speaking a visa is issued based on all the information you submitted and in particular on an assessment of the purpose of your trip and the plausibility of your plan. There is only one type of short-stay visa for all Schengen countries and all purposes but if you deviate too much from the original plan you submitted, there is always a concern that your plan hasn't been properly vetted, which defeats the purpose of the whole system. Worse, it might even suggests that you really planned to do something else from the get go and lied on your application to prevent the consulate from examining your real purpose. That would constitute fraud and is grounds to annul the visa.
There are also very specific rules regarding which country should examine a given application. For example, if you visit several countries, you are supposed to apply to the relevant consulate from the country that will be your main destination and all other consulates should decline to process your application. So while a German visa does allow you to make an incidental visit to France, Germany is not supposed to issue visa to people whose sole intention is to visit France, only France can do that.
That's why it makes sense for border guards to be a little suspicious of “unexpected” visas and why changing your plans always exposes you to additional scrutiny. At the same time, a Schengen visa is valid for the whole area and (usually) not restricted to a specific country. So unless you have one of those very unusual “limited territorial validity” visas, it's not expressly forbidden to go elsewhere.
In a way, what may happen if you show up in another country is similar to what may happen if you show up in the country that issued the visa but with way too much luggage and no return ticket. The problem is not so much that your visa isn't valid or that you have broken any rule (yet), it's a red flag that suggests you have not been entirely forthcoming and might intend to stay illegally. Therefore, border guards should not automatically deny entry (they would need to find another reason to check on the standard form, incidentally) but they might interrogate you a little more than usual.
In practice, YMMV. If everything else checks out (you did not stay too long on your first trip, you look like a tourist and go to a touristy place, etc.) border guards will most likely have no problem letting you in and might not even bother asking you about your visa. But if you show up somewhere unexpected with a visa from another country, they might ask why and then what happens will depend on the credibility of your explanation, other documents you are able to provide, etc.
Importantly, all that is equally true for two-entry visas. They are intended for a specific trip, just like single-entry visas. In particular, a two-entry visa can allow tourists to make a side trip (e.g. to the UK) in the middle of a European tour. There is no reason to issue a two-entry visa if your original itinerary did not include something like that. So a situation like yours is not really supposed to arise and it's difficult to give a definitive answer to your question.
For completeness's sake, note that multiple-entry visas are quite different in this respect. They are expressly intended for people who need to travel frequently and have proved their reliability. By their very nature, they allow an indeterminate number of trips to the Schengen area and are therefore not tied to any specific trip.