  We show that the compactly supported cohomology of certain $\mathrm{U}(n,n)$
or $\mathrm{Sp}(2n)$-Shimura varieties with $\Gamma_1(p^\infty)$-level vanishes
above the middle degree. The only assumption is that we work over a CM field
$F$ in which the prime $p$ splits completely. We also give an application to
Galois representations for torsion in the cohomology of the locally symmetric
spaces for $\mathrm{GL}_n/F$. More precisely, we use the vanishing result for
Shimura varieties to eliminate the nilpotent ideal in the construction of these
Galois representations. This strengthens recent results of Scholze and
Newton-Thorne.
