Translation:I would like to buy two blue ties.
You are buying two whole ties, so it's a whole object, hence the form "kaksi". The noun is in partitive because the number is greater than one (kolme koiraa, kahdeksan karhua, kuusi lehmää).
If you included e.g. the word "pala" (piece, bit) you could say e.g. "haluaisin ostaa palan (kahta) kravattia" and use the partitive as you would then only be speaking of a part of the tie(s).
Haluaisin ostaa (yhden) kravatin. - I would like to buy a (one) tie.
Haluaisin ostaa kaksi kakkua. - I would like to buy two cakes.
Haluaisin ostaa palan kakkua. - I would like to buy a piece/slice of cake.