Tech trees serve to provide variety on build orders by increasing requirements to use units and provide a predictable delay to avoid mass rushes.
Tech trees are generally restricted to
1.Unit/buildings upgrades:
Buildings can have different stages(Town Center in AoE) or functions(Creep colony in SC), which must be researched at the building in question.
2.Ability research. Typically a dedicated research buildings or building that produces the unit using that ability.
3.New Unit research. A unit-generator building that allows access to new or upgrade units(e.g. Elite Cannon Galeon)
Common anti-patterns:

1.Building that is only used for upgrading a unit separate from unit-producer. adds complexity b.uses building concept space for nothing.
Typical example(Armory, starcraft) is a upgrade-only building that serves no unit-producing role, doesn't attack,move and only takes space on the base.
Correct solution:Place upgrades on the building producing the units or move upgrades to an abstract category that is present independent of buildings.

2.Upgrades that add stats limited number of times, typically one.
This wastes a slot and limits gameplay variety(usually for balance issues).
Correct solution:Make upgrades usable continuously. raising costs proportionate to the effect. e.g. Upgrade that speeds zealots +X instead is changed to add X/2 speed for each upgrade until Y speed, with costs rising x2 each time.'
2a:"unit class upgrade"
One-time upgrades such as changing Unit Class X into Elite Unit Class X(AoE2) are instead should be framed as upgrades/variations of the base unit(Add Elite Tech X):
the common "Age of Empires approach" of explicitly requiring multiple unit-to-unit class upgrades can be also spread into different units with different costs for each part of the tech tree, with their own cost dependent on stats/roles of units.

A compromise between unlimited upgrades and one-time upgrades is making the upgrades unit-centric rather than unit-class centric (see ).

3.Upgrades that are needed to effectively use a unit:
Example:Overlord speed in starcraft, without upgrades are very slow.
Correct solution:Provide all units with their basic ability/stats at start.
A unit that is mostly useless without research should not exist.

4.Non-Upgradeable units. Some units,abilities or buildings don't have any upgrades(typically to provide a static balance in early game).
example:photon cannon attack in Starcraft.
Correct solution:put such units/building upgrade late into the tech tree to preserve early game balance or add higher resource cost for the upgrade.

5.Upgrades that add some stats but reduce others:
e.g. Add damage but reduce speed(to aid balance).
Correct solution:Price the upgrade higher and place it later into the tech tree.

6.Technologies researched that make earlier upgrades obsolete:
Any upgrades that give the impression that earlier upgrades are wasted resources should be removed.

7.Tech Tree filled with Junk upgrades:Upgrades/tech that is disproportionately expensive, requiring dedicated builds to properly use them.
a.Upgrades that units typically don't need such as
increased Line of sight on buildings.
b.miniscule damage/armor/speed increase for substantial resource cost.
c.making later tech dependent on junk upgrades to force player's usage of them.

8.Tech Tree dependencies that force the player to research/build everything.
a.making all build orders eventually use all tech, reducing gameplay variety.
b.forcing to construct multiple buildings solely for tech/upgrades that serve zero purpose after upgrades are research.
c.dependency on unrelated tech: a building should contain its own tech tree instead of spreading requirements across multiple buildings and upgrades.