An alliance merged into us, we didn't get the tree alliance points refunded.

Hello! So, an alliance merged into ours and we got 25k alliance points, what they had not spent. They had a level 8 tree alongside level 3 exp and level 3 rdr, so it sounds weird we didn't get us much to feed our own tree. Is this intentional? Is this a bug?

There's no such thing as merging alliances. You can think of it as everyone in that other alliance left that one and joined yours.

Your alliance points from your current team will remain unaffected. The other one is lost.

Then how did we earn 25k alliance points then?

Unions only bring over the unspent AP; everything else is lost.