Here's why:
* "Types" is a plural noun.
* "Different" acts as an adjective modifying the noun "types".
* "Two" is a quantifier indicating the number of types.
While "types" alone can be grammatically correct in some contexts, the combination of "two" and "different" specifically requires the plural form "types".