With the rapid development of information technology and the increasing diversity in the education field, personalized teaching has become the key to educational innovation. However, existing methods of customizing and distributing teaching contents often fail to effectively cope with complex teaching environments and resource constraints. To solve this problem, this study proposed a novel intelligent content distribution system, i.e., a teaching content customization method based on machine learning. First, an inverse optimization model of teaching content customization targeted at content combinations was constructed, which minimized the adjustment of configuration parameters and customized resource constraints. This model generated more reasonable and effective teaching content configuration plans by comprehensively considering content diversity, students’ needs, and resource constraints. Second, to further improve the efficiency and effect of content distribution, an intelligent content distribution algorithm based on a hierarchical reinforcement learning network was developed, which allowed the system to automatically learn and adjust content distribution strategies based on students’ needs and preferences, and optimized the teaching content configuration while meeting resource constraints. The method proposed in this study not only significantly improved the teaching effect, but also provided strong technical support for the rational allocation of educational resources, thereby bringing profound impacts to modern education. This study is of great significance for intelligent content distribution and personalized teaching in the education field.