Template definitions need to be visible to the compiler when it compiles your main file. This is typically done by putting the definitions in the header.
Remember, all source files are independently compiled by the compiler and then later linked together. This means that one source file will be completely compiled independently of another source file.
The reason it doesn't work in its own source file is because templates are instantiated by the compiler at COMPILE TIME. In order to instantiate it completely, it needs to see the entire definition of the template. When compiling a translation unit, all the template parameters are manually replaced with the template arguments. Thus, if the template definition is in a completely different translation unit, the compiler cannot generate code for something it can't see.
Templates aren't real code. The types are missing! They're just a template for real code, and since some of the types are missing they can't be compiled separately. Therefore they don't belong in cpp files.