Yes, you can create such a tower, you can't specify the tower to aim at monsters, but you can change the projectiles to damage only monsters. If the behavior is
behavior="neutral" or
behavior="penetrating" then you can change the target by changing the category in the behavior section, like this example of the large boulder inside the temple, in the desert campaign:
<projectile directions="1" collision="13" damage="1000" speed="1.5" behavior="penetrating" hit-sound="sound/misc.xml:info_boulder">
<behavior>
<dictionary>
<entry name="category-override"><string>None</string></entry>
<entry name="range"><float>1000</float></entry>
<entry name="penetration"><int>100</int></entry>
<entry name="dmg-mul"><float>1</float></entry>
</dictionary>
</behavior>
You can change the category from
None (means target all) to
Player (avoids players) or
Enemy (avoids monsters)