Inbreeding increases the risk of getting two identical recessive genes, alleles, that cause a disease which wouldn't have been activated with mixed genes. That's how I understand it anyway. But I sometimes read and hear that inbreeding among humans also causes decreased intelligence, especially emotional and social intelligence. Is there any support for such claims, and if so how does that work?
There is indeed evidence that inbreeding in humans lowers intelligence of offspring.
In summary, our comprehensive assessment revealed that parental consanguinity and degree of inbreeding was significantly associated with depression in intellectual behaviors among children. Factors other than inbreeding showed little influence, suggesting that genetic component (i.e., inbreeding) was more influential over these parameters under study. Moreover, the depression in cognitive abilities seems to be more prominent due to increase in the degree of inbreeding (F).
A thorough literature search resulted in 95 studies. There were 15 studies that provided sufficient data for a meta-analysis. The studies were divided into four categories of inbreeding, showing values of an inbreeding coefficient (f) of .046, .063 (first cousin marriage), .125 (double first cousin marriage), and .25 (incest). The study’s hypothesis of a linear relationship was strongly confirmed. Over four categories, degree of inbreeding correlated highly with average IQ depression, r = .91. The current meta-analysis shows that the most common type of consanguinity, first cousin marriage (f = .063), may lead to a depression of about six IQ points, whereas incest (f = .25), the most severe type of consanguinity may cause a depression of about 28 IQ points.
Another study reaches a similar conclusion:
This result is interpreted in light of cultural feedback theory, whereby it is suggested that consanguinity could subtly influence IQ at larger scales as a result of small IQ handicaps bought about through inbreeding being amplified into much larger differences through their effect on factors that maximize IQ such as access to education and adequate nutrition.
About the mechanism behind the IQ decline caused by inbreeding:
The study of Morton (1978) study revealed that the offspring of first-cousins had over a five times higher risk of mental retardation when compared to controls. The study concluded that declines in IQ and the increase of mental retardation are consistent with rare recessive alleles associated with around 325 loci, whose likelihood of being transmitted into offspring increases with the relatedness of the parents.
You are right. Inbreeding strongly increases overall homozygosity which subjects inbred individuals to diseases caused by rare recessive alleles. In non-inbred individuals the chance is quite low to receive those because many deleterious variants (and in fact, most segregating alleles we can observe) are recessive. Most often, but depending on the dominance coefficient, these 'hide' in healthy heterozygous carriers and when very closely related individuals breed (with a lot of variants that are identical by descent) there is a high chance that some of the 'hidden' deleterious variants are passed to the offspring.
You have to be aware that there are in fact two conceptually different processes that can be both be referred to as inbreeding but are also somewhat continuously linked (see below):
Mating systems that allow offspring between actually related individuals (measured by the degree of relatedness), what in humans often is referred to as incest or consanguinity.
Populations with very low effective population size $N_e$ generally exhibit higher relatedness due to lack of genetic diversity (excess of homozygous sites). Therefore, populations with low $N_e$ are referred to as inbred even if no actually related individuals are mating.
There is some evidence that inbreeding in the first sense is linked to cognitive abilities in humans:
Bashi (1977) investigated the effect of offspring having first-cousin (i.e. between children of siblings) and double first-cousin (i.e. between children of siblings and unrelated siblings, sharing as much variants as half-siblings but with more recombination events) parents while (at least somewhat) correcting for socioeconomic effects. He found an inbreeding depression with respect to cognition that could
result either from the general increase in homozygosity [...] or from decrease in performance resulting from homozygosity for specific recessive alleles (highlighted by me). The higher variance of the double cousin group in some of the tests favours the second interpretation.
Woodley (2012) presents evidence for slightly lower IQs caused by inbreeding, however, he also mentions that the effect is way smaller than socioeconomic effects:
Consanguinity could subtly influence IQ at larger scales as a result of small IQ handicaps bought about through inbreeding being amplified into much larger differences through their effect on factors that maximize IQ such as access to education and adequate nutrition.
Fareed and Afzal (2014) investigated verbal IQ, performance IQ, and full-scale IQ and found that all of these IQ parameters are significantly lower in inbred children compared to non-inbred children - actually the difference increases significantly with the degree of relatedness. They conclude that there is
evidence for inbreeding depression on cognitive abilities among children.
Please keep in mind that, for for sociological/ethical reasons, this is highly controversial, especially when the two concepts above are intermixed - human populations underwent differential and variably strong periods of low $N_e$, i.e. were subject to stronger or weaker inbreeding in the second sense. When reading the citation of Bashi (1977) above carefully, you will notice that he takes good care not to intermix those. Inbreeding in the first sense leaves large runs of homozygosity (ROH, blocks without heterozygous sites, i.e. a clustered and local lack of variation) whereas inbreeding in the second sense increases homozygosity in the genome less selectively. Therefore, the distribution of homozygous sites can be used to infer whether inbreeding is recent (first sense) or old (second sense) (see for example McQuillan et al. (2008) - here you see that both concepts form a continuum: where do you set the cutoff between recent and old? what is an appropriate threshold size for ROH? ...). Regardless, Bashi's findings indicate that effects of inbreeding are caused by recent inbreeding as he presents evidence that his results are rather driven by specific deleterious recessive variants than overall excess homozygosity. Finally, even though the study by Fareed and Afzal (2014) shows rather large effects of recent inbreeding in IQ measures, the results from Woodley (2012) show that one needs to be really careful to separate genetic from environmental components as his study suggests that the latter contribute more to the observed decrease in IQ.
Inbreeding, in nature at large, has one primary effect, as you said. It increases the chances of two copies of harmful, recessive alleles. Consequently, offspring are much more likely to suffer from genetic and/or degenerative diseases.
As for intelligence, some studies have indeed concluded that inbreeding can lead to a lower IQ (see this answer for the exact quotations), it is possible that there are other factors at play. For instance, those from a lower socio-economic background tend to be of lower intelligence, although as with everything there are exceptions. Whilst I have struggled to find a source for this, it is statistically more likely that those of a lower socio-economic background will exhibit poor mental health and/or partake in the act of inbreeding.
Consequently, due to the fact that intelligence is largely heriditary, the offspring of inbreeding will tend to be less intelligent. As a result, it is difficult to determine that there is a causal relationship between these correlating factors.