The order is determined by logic. For example, the routing header is the only extension header that routers should ever need to examine, as the packet is routed. So it makes sense that routers should not have to parse through other headers that they cannot use.
The fragment header comes next, because the destination node needs to know that all fragments have been reassembled, before it can make use of other extension headers. In IPv6, fragmentation and reassembly are done by the end systems only.
The destination options extension is used to describe what kind of padding is used, by options after this one. So the destination node needs this information, before it can process subsequent extension headers.
And so on. Any security header must be used after the packet has been reassembled, for example, so they come toward the end.
see the pages 357 and 358 (Fig. 7.3-3: IPv6 Packet with all expansion headers in the prescribed order) in book "Technology of the IP networks" (in german: Technik der IP-Netze)
The Hop-by-Hop Options Header contains so-called Type-Length-Value data (TLV data), which are referred to as options. Since these TLVs are interpreted in each Router (intermediate system) on the road, this header must be directly after the IPv6 header. This reduces the time necessary for packet switching in Routers.
Destination Options Header
The Destination Options Header can appear twice in an IPv6 package. It contains the TLV data for both the router and the target system. If a Destination Options Header contains the TLV data for routers, this header follows the hop-by-hop options header. The TLV data for the target system is transported in a different Destination Options header, which should be positioned at the end in the header sequence.
Routing Header
The Routing Header (RH) specifies a list of routers or other intermediary systems that must 'visit' the packet to be transmitted on the way [Fig. 7.6-1]. There are already several RH types. With RH Type 0, an IPv6-based source routing was initially proposed in RFC 2460, but [RFC 5095] was rejected because of security considerations. However, we want to go into the concept in section 7.6.
RH Type 2 is used with Mobile IPv6 [Section 15.4]. RH types 1, 3 and 4 were only proposed in Internet Drafts.The TLV data for the target system is transported in a different Destination Options header, which should be positioned at the end in the header sequence.
Best regards
Anatol Badach
Book Technik der IP-Netze, Internet-Kommunikation in Theorie und Einsatz