TL;DR: Wikipedia's numbering is mostly redundant.
Why did Wikipedia number the contents at all?
From a UX perspective, people expect the table of contents to be numbered
- Because books have numbered contents.
- Without the numbers, it wouldn't be so immediately obvious that it's a table of contents.
It's unlikely the numbers are there for citation purposes
- I've not found a single instance where somebody has cited the section number of a Wiki.
- No major referencing guides (Harvard/APA/Chicago/IEEE) accommodate section numbers in references to Wikipedia articles.
Why did Wikipedia not put the section number before the headings?
One justification might be that it's not required on websites because you can use hyperlinks instead.
But the heading numbers are missing from the Printable Version and Create a Book version too.
This backs up that there's no other purpose aside from making the contents look like contents.
What's the best practice for numbering?
There are benefits to numbering your headings.
As Devin writes in the comments:
[There is] the need of numbers to follow a mental path, specially in long articles. For example, if in TOC I click on item list 4, having a numbered header will remind me of the items I left behind just in case I need to go back to find some information.