Let C be a smooth projective curve of genus g ≥ 2. Fix an integer r ≥ 0, and let k = (k1, . . . , kn) be a sequence of positive integers with n i=1 ki = g − 1.In this paper, we study npointed curves (C, p1, . . . , pn) such that the line bundle L := OC n i=1 kipi is a theta-characteristic with h 0 (C, L) ≥ r + 1 and h 0 (C, L) ≡ r + 1 (mod. 2). We prove that they describe a sublocus G r g (k) of Mg,n having codimension at most g − 1 + r(r−1) 2 . Moreover, for any r ≥ 0, k as above, and g greater than an explicit integer g(r) depending on r, we present irreducible components of G r g (k) attaining the maximal codimension in Mg,n, so that the bound turns out to be sharp.