Joaquim M., Puigvert i Solà, Església, territori i sociabilitat (s. XVII-XIX)