In this paper we study existence and spectral properties for weak solutions of Neumann and Dirichlet problems associated with second order linear degenerate elliptic partial differential operators X with rough coefficients, of the form X = −div(P ∇) + HR + S G + F , where the n × n matrix function P = P (x) is nonnegative definite and allowed to degenerate, R, S are families of subunit vector fields, G, H are vector valued functions and F is a scalar function. We operate in a geometric homogeneous space setting and we assume the validity of certain Sobolev and Poincaré inequalities related to a symmetric nonnegative definite matrix of weights Q = Q(x) that is comparable to P ; we do not assume that the underlying measure is doubling. We give a maximum principle for weak solutions of Xu ≤ 0, and we follow this with a result describing a relationship between compact projection of the degenerate Sobolev space QH 1,p , related to the matrix of weights Q, into L q and a Poincaré inequality with gain adapted to Q.