@Igor Pisov -
Interesting point of view, but WordPress Themes become more complex and its sometimes difficult to keep all their functionality away from their own framework or structure.

Themes should be presentational, period. The primary problem in the market is that end users are unaware of the problems created by Themes defining site functionality and content generation. All we can do is actively try to educate end users, and eschew marketing tactics that are harmful to end users.

Yes, there are plugins, and themes are primarily intended to represent the look of the websites, but people are willing to have an all-in-on solution.

Again, the problem is end-user education. That "all-in-one" solution is and will be harmful to the user. Users are "willing" to have that "all-in-one" solution because they are unaware of the harm such a solution causes.

Probably there should be certain rules or standards to somehow separate the visual representation from the functionality...

The Theme Review guidelines for Themes hosted in the official WPORG Theme Directory prohibit Themes from implementing non-presentational (i.e. "Plugin territory") functionality. Other directories are starting to follow suit, including ThemeForest.

...and in the same time to keep the layout attractive for customers.

Google Analytics (and myriad other functional elements) have absolutely no impact on the layout, whether added via Theme or Plugin. They are fully functional, and not at all presentational. Thus, the attractiveness of the layout cannot be adversely impacted by placing that functionality properly within a Plugin.