Species that practice sexual cannibalism (spiders and mantises) have two things in common. First, they tend to be low-energy ambush predators that spend a lot of time waiting for food; pregnancy will take a lot of energy out of them that they may not have to spare and therefore it is highly advantageous for the developing offspring if the mother gets a free meal to help produce them. Second, they live in an environment where potential mates live far apart and getting killed is easy; as such, the chances of a male finding a second mate are very low, so the best way for him to pass on his genes is to ensure that the children from his first mating survive.
Intelligence, at least in the species familiar to us, favors safe, social environments. Parents tend to have few children and spend a lot of energy teaching those children, which implies that the chances of any one child surviving to reproduction should be reasonably high.
However, there is one exception to this rule: the octopus, a solitary species with a lifestyle not entirely unlike spiders and mantises, yet is nonetheless fairly intelligent, apparently for the purpose of adapting to a changing environment and large amount of food sources, many of them shelled creatures that are tricky to open. They also put a large amount of energy into a single mating, to the extent that it kills them, and sexual cannibalism is quite common among them as well. So I would use them as a base: an initially solitary species that lives in a dangerous world, that eats a large variety of hard-shelled creatures that they need to be smart to open up.
Ancient History
Unlike in humans, where intelligence largely grew out of social behavior, intelligence in this species would be driven by complex nesting practices. The female builds a burrow that is difficult to get into, and waits in the center. Only males intelligent enough to find their way to the center of the nest would have the privilege of mating. Due to sexual selection, this would increase the intelligence of the species as a whole over time. As these nests increased in complexity, they could develop into temple-like structures, the builder serving the role of the "goddess" at the center, with males spending their entire lives trying to crack the puzzle that would allow them to achieve fulfillment by dying in the sacred jaws of their chosen mate.
The female would need to stockpile food, and would probably be able to go into a kind of hibernation or stasis to survive until the male made it to the center.
Male and female societies could develop independently, with females assisting other females in constructing elaborate temples, and males joining together in "adventuring parties" to help each other reach the center - in other words, a "dungeon crawl" species! Either the females who built the temple would wait in the center as a group, allowing all the males in the party to mate at once (markings outside the temple could indicate how many females are at the center) or there would be a single "leader" of every construction/party, with the younger "assistants" benefiting by gaining experience in building/exploring for the time that they would build/explore a nest on their own.
Or the males could just fight to the death once they reach the center. That works too.
Relevant post
Modern Era
A spacefaring race probably won't be spending its time building temples, but the societal conventions will be built around those that developed in its early history. Males and females will likely live separately and have different natural skillsets: females will be architects, and males may be engineers that like to solve puzzles.
Marriage will be very different from that of human culture. It will be a long period of preparation that culminates in a single act of sex, followed by the female eating the male. During this period, the male may teach the female all the information he collected over the course of his life, information which the female later teaches to her children.
Religion and sex will likely be highly intertwined; and being eaten after sex will be seen as the ultimate fulfillment of a male's life.
It is, however, possible for a male to either escape from a female after mating without being eaten, or to mate with a female who has already selected her partner. Either one would be considered "cheating". To prevent males from escaping, there may be a traditional "marriage burrow" based on the design of the ancient temples, which are designed to be physically difficult for an unwelcome male to enter, and also difficult for the male partner to escape without his mate catching and eating him. When couples forgo this traditional burrow and the male ends up leaving, conservative parents will tell their daughters that they should have stuck with tradition.