The rabbis established the rule that male children were allowed to go as far as the Court of Women because they were considered to be under the protection of their fathers. However, once they reached the age of 13, they were considered to be adults and were required to follow all of the same rules as men.
There were some exceptions to this rule. For example, if a male child was orphaned, he was allowed to go as far as the Court of Israel. This was because he was considered to be under the protection of the community.
In general, male children were required to remain in the Court of Women even if they were male. This was because they were not considered to be old enough to understand the sanctity of the Temple and to follow all of the rules that applied to men.