Yes, in cases of Marriages, caste indeed matters, for MOST of the Hindu people, including me. Because-

(1) First of all, in your marriage, it is extremely important, how your spouse looks. Now, In General, if your spouse is from a higher caste (compared to yours), then he/she will be generally better looking compared to you. If he/she is from a lower caste, then he/she will look inferior compared to you (in general). In first case, you are not able for your spouse. In second case, your spouse is not able for you. So for optimality, we go for our own caste (or a caste close to our rank).Surely there are exceptions, but still caste helps us to refine our search for spouse.

(2) If you go for intellect, physical-strength, behaviour, thoughts and other charecteristics, then also the reason is same as I stated in (1). Note that, the last two charecteristics (behaviour, thought) are non-hierarchical (can not be ranked), but the pattern of behaviour or thought are observed to be homogeneous within a caste (at least in rural society). For example, Some castes are consideres as too clever, some are too selfish, some are honest, depending on the professions related to the caste. It is observed that, even after being detached from the profession for generations, their nature does not changes. So marrying within your own caste gives you some amount of security.

(3) Though Islam is an egalatorian religion, Muslims often prefer to marry within closed blood relations, due to the same cause, that I mentioned in (1) and (2). But marrying within closed blood relation, can produce handicapped children. So for optimality, we (Hindus) have caste system, so that your spouse is neither your close relative, nor a very distant person. Distant blood relations are entertained in Hindu marriages (specially in my own caste group).

Chandan Pal,
Kolkata.
_________________________
Chandan Pal, India andham tamah pravishanti ye avidyaamupaasate, tato bhooya iva te tamo ya u vidyaayaam rataah. - Ishopanishad.