As others have said, the first form is the correct one:
He sometimes speaks Spanish, which I can't understand.
You could make the second one acceptable by changing the word which to the indefinite article a:
He sometimes speaks Spanish, which language I can't understand.
He sometimes speaks Spanish, a language I can't understand.
I concur with Victor that the in is optional in both cases, with little difference in the overall meaning:
He sometimes speaks in Spanish, a language I can't understand.
However, this is true for the verb speaks. If we swap out the verb speak for another verb, then the in might become mandatory:
He sometimes says words in Spanish, which I can't understand.
He sometimes says words Spanish, which I can't understand.
He sometimes orates in Spanish, a language I can't understand.
He sometimes orates Spanish, a language I can't understand.
Moreover, sometimes the preposition could be included or omitted, depending on what you are trying to say; for example:
He sometimes narrates Spanish, a language I don't understand.
He sometimes narrates in Spanish, a language I don't understand.
I'd be more inclined to use the first one if he is narrating from a Spanish text, but more inclined to use the second one if he is translating English on the fly and thus narrating in Spanish.