Marriage is not necessarily anti-spiritual but generally absorbs a lot of time and energy leaving a little for higher pursuits especially if the two people are not in sync with each other’s aspiration. As to sex, it is a normal and natural instinct which is supposed to serve the purpose of propagation of the species. However, the mind adds to it much perversity to enhance pleasure. In itself it is not a problem if one is seeking pleasure but as far as the spiritual life is concerned it keeps us tied to the gross and crude animal instincts and the excitement and unconsciousness that follows often opens doors to many negative forces that are inimical to a higher life. It keeps the energy tied to lower levels leaving little that could be available for higher ascension.
A progressive shift from the gross and crude to the subtle and the refined ways of life can be done through marriage or without it if one has the sincerity of aspiration. If this critical sincerity and aspiration is missing, merely living single and alone is not enough.
For most people it is perhaps better to go through the experience of human love and togetherness as taken rightly this itself can be a preparation for the spiritual life than staying away out of taboo or fear and guilt and incomprehension. No general rule can be therefore made for these things and each one must feel for oneself.