As far as your first question - there are several sources that note that he was most definitely not a tzaddik. @NT has pointed out the famous gemara, but in addition we can also observe the following:
Yerushalmi Peah 1:1 - Achitofel (along with Doeg) enjoyed speaking lashon hara (evil speech) - "אֶשְׁכְּבָה לוֹהֲטִים זֶה דּוֹאֵג וְאַחִיתוֹפֶל שֶׁהָיוּ לְהוּטִין אַחַר לָשׁוֹן הָרַע"
Gemara Berachos 17b writes specifically:
״אֵין פֶּרֶץ״ — שֶׁלֹּא תְּהֵא סִיעָתֵנוּ כְּסִיעָתוֹ שֶׁל דָּוִד שֶׁיָּצָא מִמֶּנּוּ אֲחִיתוֹפֶל.
“There is no breach”; that our faction of Sages should not be like the faction of David, from which Ahitophel emerged, who caused a breach in the kingdom of David. (Sefaria translation & notation)
An even those sources that point out that he was learned in Torah e.g. Chagigah 15b it wasn't heartfelt as he did not truly practise it. The Midrash Tehillim/Shocher Tov 119 writes:
סלית כל שוגים מחקיך וגו'. מהו סלית כל שוגים החוטאים בא דואג ולמד את התורה ולא עשה אותה וחלפת אותו. בא אחיתופל מעלה פנים ולמד את התורה ולא קיימה וחלפת אותו
You reject all who stray from Your laws - What does it mean "You reject"? i.e. All sinners err. Came Doeg and studied the Torah and did not do it and You passed him. Achitofel came (with elevated face?) and learnt Torah and did not keep it and You passed him.
Likewise, refer to the Midrash in Bamidbar Rabbah 18:17 which likens Achitofel to a house full of straw. Initially the house is all plastered nicely, hiding the straw, but over time, the straw begins to emerge out of the holes. As such:
כָּךְ דּוֹאֵג וַאֲחִיתֹפֶל לֹא הָיוּ בָּהֶן מִצְווֹת מִתְּחִלָּה, אַף עַל פִּי שֶׁנַּעֲשׂוּ בְּנֵי תוֹרָה הָיוּ כִּתְחִלָּתָן, הֱוֵי (תהלים נה, טז): כִּי רָעוֹת בִּמְגוּרָם בְּקִרְבָּם
Just as Doeg and Achitofel did not have mitzvos at the beginning, so too, even though the became Torah scholars they remained as they had been at the start. (This is the meaning of), "For where they dwell, there evil is".
Perhaps the Midrash Tehillim/ Shocher Tov 49:2 encapsulates it best:
יחד עשיר ואביון. עשיר בתורה ואביון בתורה כולן יורדין לגיהנם. עשיר בתורה זה דואג ואחיתופל. לפי שלא שמרו את התורה ירדו לגיהנם אף על פי שהן ראשי סנהדראות. ואביון בתורה כל מי שיש סיפק בידו ללמוד ולא למד
"Rich and poor alike" - rich in Torah and poor in Torah they all descend to hell. "Rich in Torah" - this is Doeg and Achitofel since they did not keep the Torah they descended to hell even though they were heads of the Sanhedrin. And "poor in Torah" refers to all who have the capacity to learn and don't learn.
As far as your point:
What I don't understand here is that he did not agree of David's reign because of the "sin" with Batsheva (I believe his grand-daughter if I'm not mistaken) so how did he justify telling Absalom to sleep with all of David's wives when clearly this is a HUGE violation of the Torah.
The Yalkut Shimoni Shmuel 151 notes that he fundamentally erred in his readings of the mazalos (constellation) thinking that he would rightfully become king and that is why he advised Avshalom to act as he did.
בוא אל פלגשי איבך אחיתופל הטעה אותו המזל והיה סבור שהוא מלך והי נותן עיניו באבשלום אמר לו בוא אל פלגשי אביך, א"ל וכן אתה אומר לי שאענה פלגשי אבי, א"ל אחיתופל גזירת האלהים היא שאמר לאביך הנני מקים עליך רעה מביתך וגו' ושכב (את) [עם] נשיך, ואחיתופל יעץ לאבשלום שיהרוג לאביו והוא ישב עליו בדין על שעינה נשי אביו ואני הורגו ומולך אני, ולא היה יודע שהמלכות עומדת מבת בנו שנאמר הלא את בת שבע את אליעם, ואליעם בן אחיתופל הגילוני
Consort with the concubines of your father - Achitofel erred with (his reading of) the constellations into thinking he would be king. Therefore, he fixed his eyes on Avshalom. He (Achitofel) said to him (Avshalom), "Consort with the concubines of your father". He responded, "Is this what you say to me - to ravish the concubines of your father?!" Answered Achitofel, "It is a decree of G-d" - he said to your father "I will make a calamity rise against you from within your own house" and he lay with your wife. (Furthermore) Achitofel advised Avshalom to kill his father and he would (eventually) sit in judgement (with regards to Avshalom) for ravishing his father's wives, then he would kill Avshalom and become king. But he did not realise that the kingship would only come through his son's daughter Batsheva, daughter of Eilam, son of Achitofel.
So we see from the Midrash that Achitofel was making a very calculated move in his bid for power, making Avshalom act as he did, so that he could thereby make him guilty and thus remove another contender for the throne.