There is no principal group (alkoxy group can only be named as prefix, and cannot be named as principal group) and no C-C multiple bond in the compound. Therefore, the parent chain should contain the maximum number of carbon atom.
For methoxyethane, ethane is the parent chain which contains 2 carbon atoms. For ethoxymethane, methane is the parent chain which contains 1 carbon atoms only. Therefore, the IUPAC name is methoxyethane.