You are correct that the kinetic theory of gases relates temperature to the average kinetic energy of gas molecules. However, the key to understanding the ideal gas law and the properties of an ideal gas is recognizing that ideal gases are a simplified, theoretical model that does not perfectly represent real gases.
The ideal gas law (PV = nRT) treats all gases as if they are composed of point particles that only interact through perfectly elastic collisions. It assumes that the particles have no volume and do not exert any attractive or repulsive forces on one another. Because of these simplifications, the ideal gas law does not take into account differences in molecular mass or other specific properties of the gas particles.
In reality, as you pointed out, the mass of gas molecules does affect their kinetic energy and the pressure they exert. Real gases deviate from ideal behavior, particularly at high pressures and low temperatures where intermolecular forces and the size of the particles become significant.
In many cases, however, the ideal gas law provides a useful approximation for real gases because, under a wide range of temperatures and pressures, the behavior of many gases is relatively independent of the specific properties of the molecules. This is particularly true for monatomic gases (e.g., helium, neon, argon) and some diatomic gases (e.g., nitrogen, oxygen) when they are not too dense or too cold.
When dealing with real gases that deviate significantly from ideal behavior, scientists use more accurate models, such as the van der Waals equation or other equations of state that take into account molecular size and intermolecular forces. These models provide a more accurate representation of the behavior of real gases, including the dependencies on molecular mass and other specific properties of the gas particles.