In this paper, we propose a two-layer game-theoretic framework to solve the network selection problem in heterogeneous wireless networks (HetNets). At the intra-network layer, a hierarchical game among the SP and its admitted users is employed, and the closed-form equilibrium solutions for the pricing and transmission rate are provided. Meanwhile, at the inter-network layer, all service providers (SP) and the active users are engaged in a dynamic hedonic game and finally self-organized into a Nash-stable coalition structure. The key feature of our proposed approach is the inclusion of social-behavioral (SoBe) constraints capturing the real-world user and SP preferences, hierarchy and membership. Not only that SoBe more accurately models practical scenarios, it also leads to markedly reduced unnecessary handovers, and well maintained call blocking rate. Simulations confirm the superior performance of SoBe in comparison with the widely adopted user-driven alternative in terms of nearly all critical performance criteria.