Daddy, Why Do I Have to Wear a Yarmulke?

The famous Taz Orach Chaim 61:3 in explaining why head-covering for men is obligatory (in Devarim Shebekdusha) says this:

ומכל מקום נראה דעכשיו שחוק שלהם הוא כן ודאי יש אפילו איסור בזה משום ובחוקותיהם לא תלכו

I understand this to mean one may not specifically uncover one’s head for prayer like the Cursedians do, but there is no problem to leave it uncovered; how can there be a prohibition of “Bechukoseihem” (following non-Jewish idolatrous customs) on doing nothing (Shev ve’al ta’aseh)?!