The answer to your question requires that we "factor in" the nature and context of what was happening in the book of Acts.
The infant church is just that: an infant. Infants have few, if any, experiences--whether their own or others'--to serve as guides in "how things work."
The church is grappling with a learning curve during this time of transition, from Judaism to a religion of "The Way," from synagogue to ecclesia, so to speak.
The church (specifically, local churches like the one--possibly more than one--in Samaria) may not have had time to be established in the faith by hearing systematic and thorough preaching and teaching on the foundational truths of the word, such as the baptism of the Holy Spirit.
Churches would have to wait years before they had written copies of Scripture from the hands of the apostles and from the copyists/scribes who duplicated those scriptures.
The Context of Transitions
One key term to consider when attempting to make sense of what was going on in the book of Acts is transition. I cannot emphasize this word too much. In any new venture, whether it is establishing a new company or establishing a local church, times of transition require a host of adjustments and the attendant growing pains.
Complicating things in the book of Acts, there were disparate groups of people (e.g., Jews and Gentiles) in widely scattered locations (or "all who are far off," as Peter remarked in Acts 2:39) in a time when books were scarce, cars were non-existent, and rapid communication could be measured in how many days, not minutes, it took to travel from Jerusalem to Samaria with a hand-carried epistle from an apostle Paul to the church in Corinth, for example. Today's "snail mail" is lightening fast in comparison!
Taking all these things into consideration, then, we can see that during a time of transition and rapid growth, with 5000 conversions on Pentecost alone, including people of various languages returning to their home towns and villages where the only "church" was either a synagogue (!) or a house group, there were bound to be stop-gap measures and ad hoc solutions to the pressing needs of believers everywhere!
The Context of Nascency
Perhaps with these things in mind, we can better understand how a "primitive church" would be lacking certain critical information regarding the basic doctrines of the apostles. Notice I said apostles, not Scripture, since again, for the longest time there were no Scriptures in the time of Acts, at least not in the form in which we think of them today. One such doctrine is what we today call pneumatology, the study of the person and work of the Holy Spirit.
Instead of getting into a long-winded explanation--my usual modus operandi--of how we can fit this transitional occurrence which occurred to the Samaritan Christians, I'll simply suggest that the believers there received the Holy Spirit the way we all do: immediately upon their conversion (or new birth, or regeneration, or being born from above, or being saved, or being "in Christ").
As Constable observed in his "Notes" in the NET Bible:
"In chapter 2 [of Acts] God identified Spirit baptism—-which normally takes place without the believer being aware that it is happening—-with wind, fire, and speaking in tongues. These things served as signs to the Jews present [in Jerusalem on the Day of Pentecost] of God’s working. Here in chapter 8 [, however,] signs apparently did not announce the baptism of the Spirit but accompanied Philip’s preaching. What would have impressed the Samaritans that the baptism of the Spirit was taking place? And what would have impressed the Jews in Jerusalem that it had taken place in Samaria? The Spirit’s baptizing work taking place in response to the laying on of the apostles’ hands would have done so. This is, of course, exactly what happened."
The Context of Extraordinary Measures
In other words, extraordinary circumstances call for extraordinary measures. That the Samaritan converts to "the Way" didn't know anything about the Holy Spirit, how would they know that they had in fact been baptized by that Spirit when they were first converted? Clearly, they would not.
That is why the apostles, John and Peter, laid hands on them, and that is why Luke, the author of Acts, said that the Samaritans received the Holy Spirit through the laying on of hands. Just as the water baptism the Samaritans had already received marked them as Christians but did not make them Christians, so too with the laying on of hands: it did not make them a part of the body of Christ, but it did mark them as part of the body of Christ.
ADDENDUM
I think it significant in Acts 8:15 and 16 that Luke tells us the apostles prayed the Samaritan believers would receive the Holy Spirit because
"the Spirit had not yet come upon any of them, but they had only been baptized in the name of the Lord Jesus."
Notice Luke's use of the words receive and come upon (in bold, above). Neither verb--one of which is a verb with preposition--is as specific and as accurate as two terms the apostle Paul would later use in the developing canon of Scripture. (Remember, the NT canon came into existence over the course of years, not instantaneously, or even over the course of months and years.) Those words are baptized and sealed.
"In Him, you also, after listening to the message of truth, the gospel of your salvation--having also believed, you were sealed in Him with the Holy Spirit of promise, who is given as a pledge of our inheritance, with a view to the redemption of God's own possession, to the praise of His glory" (1 Corinthians 12:13 NAS).
"For by one Spirit we were all baptized into one body, whether Jews or Greeks, whether slaves or free, and we were all made to drink of one Spirit" (Galatians 3:27 NAS).
"There is one body and one Spirit, just as you too were called to the one hope of your calling, one Lord, one faith, one baptism, one God and Father of all, who is over all and through all and in all" (Ephesians 4:4-6 NET).
The sealing and baptizing work of the Holy Spirit occurs at conversion. When we believe in the Lord Jesus Christ and step by faith out of our spiritual death and darkness, we step into God's "marvelous light" (1 Peter 2:9) and become a new creation in Christ (2 Corinthians 5:17). The Holy Spirit, in other words, is the agent of the transformation and the agency is His baptizing work in the heart of a new believer.
The Samaritan Christians in Acts 8 had already believed and had received water baptism. Not knowing that water baptism is but a outward symbol and rite of an inner transformation which is the work of the Holy Spirit alone, the Samaritan believers needed a special (perhaps even unique) hands-on demonstration, or visual aid, if you will, of what had already happened to them when they first believed.
In conclusion, if we limit our analysis of what occurred in the Samaritan church to the book of Acts, we are not observing the analogy of Scripture, which says in essence that Scripture is the best interpreter of Scripture, and that the largest possible context for a given passage is the complete canon of Scripture. Moreover, sometimes that hermeneutical principle invokes another hermeneutical principle; namely, later Scriptures can sometimes help us interpret earlier scriptures, teachings and/or events.
For all of you who were baptized into Christ have clothed yourselves with Christ.