Unless an AoE spell has a specific exception, it doesn't affect creatures through walls. To establish the type of spell Spirit Guardians is, we have the following:
Spells that create cones or lines of effect that originate
from you also have a range of self, indicating that the
origin point of the spell’s effect must be you (see “Areas
of Effect” later in the this chapter).
Spirit Guardians has:
Range: Self (15-foot radius)
so it clearly fits into this category. The important rule here is on page 84 of the Player's Basic Rules (page 80 if you have an older version of the basic rules PDF), under the Areas of Effect section:
A spell’s effect expands in straight lines from the point
of origin. If no unblocked straight line extends from the
point of origin to a location within the area of effect, that
location isn’t included in the spell’s area. To block one of
these imaginary lines, an obstruction must provide total
cover, as explained in chapter 9.
So if a creature has total cover from the point of origin, they're not affected by Spirit Guardians.
However, in this case, the targets can be affected if they're standing directly behind the arrow slit.
A target with three-quarters cover has a +5 bonus
to AC and Dexterity saving throws. A target has threequarters
cover if about three-quarters of it is covered
by an obstacle. The obstacle might be a portcullis, an
arrow slit, or a thick tree trunk.
So if the enemies are behind the arrow slits, they have three-quarters cover rather than total cover, and they can be affected by Spirit Guardians.
There is an additional potential issue with this strategy, but that was covered in this question.