癖(くせ) is a 名詞(めいし) (noun) that means ‘habit’ or ‘tendency’. However, as it usually refers to a negative thing, ‘vice’ is another accurate translation.
くせに (usually appearing without kanji) is the combination of くせ, and the 格助詞(かくじょし) (case marking particle) に. This structure is often used to criticize the actions of others, and is used in a similar way to ‘despite’, ‘even though’, or ‘and yet’ in English.
As くせ is a noun,
くせに may be used after the 連体形(れんたいけい) (attributive form) of any other word.
-
さっき寝(ね)るって言(い)ってたくせにまだ起(お)きてるの?
Even though you said that you are going to sleep earlier, are you still up?
若(わか)いくせに何(なに)ダラダラしているんだ。
Why are you working so sluggishly even though you are young?
自分(じぶん)だって下手(へた)なくせに何(なに)偉(えら)そうに言(い)ってるんだ。
Despite you also being no pro, why are you talking so high and mighty.
この子(こ)は犬(いぬ)のくせにニャーと鳴(な)く。
Even though he is a dog, he meows.
癖(くせ) is a word that has developed a ‘negative’ meaning over time. Originally, 癖(くせ) was used to convey a preference, or the side that someone or something tended to lean toward (due to it being favorable for some reason). When adding the 格助詞(かくじょし) に to this, it merely expressed that (A) was the preferable state/location, so (B) not being/not acting in a way appropriate for (A) is less than desirable.